//argument0 - The index of the selected key item.
//Set deleteable to 1 if it IS.
deleteable = 0;


//HxpPlugn
if(argument0 == 1)
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//RmtPlugn
else if(argument0 == 2)
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//MskPlugn
else if(argument0 == 3)
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//TakABrak
else if(argument0 == 4)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Run";
global.iv_actions[2,0] = "Execute Take-A-Break.exe";
global.iv_actions[3,0] =
"{
datafile_export(takeABreak,'BNO Data\take-a-break.exe');
execute_program('BNO Data\take-a-break.exe',0,0);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//DuoPlugn
else if(argument0 == 5)
{

global.iv_actions[0,0] = 2;

global.iv_actions[1,0] = "Usage";
global.iv_actions[2,0] = "Learn how to use the duo system.";
global.iv_actions[3,0] =
"{
caddline('The duo system allows any two navis with DuoPlugn to partner into a duo. A duo consists of a spotter and a digger. To set up a duo:',global.c_server);
caddline('+Move close to another navi with DuoPlugn until you see their name in the bottom right corner.',global.c_server);
caddline('+Press Ctrl+D to request a duo as their digger, or Ctrl+S to request as their spotter.',global.c_server);
caddline('+If you have received a duo request, use the `accept command to begin the duo.',global.c_server);
caddline('+The intended role of spotter is to stay in one place at a time, guiding the digger and acting as a checkpoint for the digger to come back to.',global.c_server);
caddline('+The intended role of digger is to attempt riskful challenges, taking advantage of the duo system to perfect his/her skill.',global.c_server);
caddline('To end a duo, either move close to your partner and press Ctrl+D/S, or else teleport to different zones.',global.c_server);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";
global.iv_actions[1,1] = "Benefits";
global.iv_actions[2,1] = "Learn about the benefits of the duo system.";
global.iv_actions[3,1] =
"{
caddline('The benefits of being in a duo are as follows:',global.c_server);
caddline('+Summoning/joining auto-accepts between the pair,',global.c_server);
caddline('+Summoning/joining between a duo is successful regardless of zone link data acquiration,',global.c_server);
caddline('+The pair may speak to eachother unhindered by their distance apart,',global.c_server);
caddline('+The spotter may use the `watch command to toggle watching the digger.',global.c_server);
caddline('+Spotters can use arrows keys to pan the view while watching their digger.',global.c_server);
caddline('+When the digger falls, (s)he instantly joins the spotter,',global.c_server);
caddline('+Where the Digital Abyss would interfere with the efforts of the duo, the pair is instead sent to the typical post-fall area together.',global.c_server);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//WrpPlugn
else if(argument0 == 6)
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}


//----------Mod Items----------

//Executor
else if(argument0 == 900)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
execute_string(clipboard_get_text());
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Query
else if(argument0 == 901)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
execute_string('meh = ' + keyboard_string + ';');
caddline(keyboard_string + ' = ' + string(meh),global.c_server);
keyboard_string = '';
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Net Executor
else if(argument0 == 902)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
clearbuffer();
writebyte(20);
writebyte(0);
writestring(clipboard_get_text());
sendmessage(global.s_tcpsocket);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Net Query
else if(argument0 == 903)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
clearbuffer();
writebyte(20);
writebyte(1);
writestring(keyboard_string);
sendmessage(global.s_tcpsocket);
keyboard_string = '';
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Net Target
else if(argument0 == 904)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
clearbuffer();
writebyte(20);
writebyte(2);
writestring(keyboard_string);
sendmessage(global.s_tcpsocket);
keyboard_string = '';
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Net Control
else if(argument0 == 905)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
clearbuffer();
writebyte(20);
writebyte(3);
writestring(clipboard_get_text());
sendmessage(global.s_tcpsocket);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Location
else if(argument0 == 906)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
iv_additem(3,'0|1]'+keyboard_string+'|2]'+global.area+'|3]'+string(global.zone)+'|4]'+string(server.x)+'|5]'+string(server.y));
caddline('There.',global.c_getdata);
keyboard_string = '';
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//MasMod
else if(argument0 == 907)
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Net Populate
else if(argument0 == 908)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
clearbuffer();
writebyte(20);
writebyte(4);
sendmessage(global.s_tcpsocket);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}
//Joker Shell
else if(argument0 == 909)
{

global.iv_actions[0,0] = 1;

global.iv_actions[1,0] = "Trigger";
global.iv_actions[2,0] = "Activate this item.";
global.iv_actions[3,0] =
"{
if(imobilecheck() && server.sprite_index != TeleIn && server.sprite_index != JoinIn && server.sprite_index != TeleOut && server.sprite_index != JoinOut)
{
if(!server.jshell)
{
instance_create(server.x,server.y,ncolchange);
if(string_pos('Run',sprite_get_name(server.sprite_index)) != 0)
  execute_string('server.sprite_index = '+string_replace(sprite_get_name(server.sprite_index),'Run','Stand')+';');
with(instance_create(server.x,server.y,jokershell))
  sprite_index = server.sprite_index;
server.sprite_index = NaviStandD;
global.curspeed = 7;
server.jshell = 1;
}
else
{
global.mbout = 1;
if(string_pos('Run',sprite_get_name(server.sprite_index)) != 0)
  execute_string('server.sprite_index = '+string_replace(sprite_get_name(server.sprite_index),'Run','Stand')+';');
server.fspeed = 0;
view_object[0] = jokershell;
with(instance_create(jokershell.x,jokershell.y,ncolchange))
  depth = jokershell.depth - 1;
jokershell.sprite_index = JoinOut;
}
keyboard_key_press(vk_control);
keyboard_key_press(ord('I'));
keyboard_key_release(ord('I'));
keyboard_key_release(vk_control);
}
else
{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}
}";

}


//Anything Uncovered
else
{

global.iv_actions[0,0] = 0;

global.iv_actions[1,0] = "On/Off";
global.iv_actions[2,0] = "It's always on.";
global.iv_actions[3,0] =
"{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}";

}



if(argument0 >= 900 || deleteable)
{

global.iv_actions[0,0] += 1;

global.iv_actions[1,global.iv_actions[0,0]-1] = "Delete Data";
global.iv_actions[2,global.iv_actions[0,0]-1] = "Remove " + global.iv_selicon;
global.iv_actions[3,global.iv_actions[0,0]-1] = 
"{
tempint = iv_collapse(1," + string(iv_itemsearch(1,global.iv_itemtable[global.iv_sely,global.iv_selx])) +
");
caddline('" + global.iv_selicon + " has been deleted from the inventory.',global.c_server);
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
if(tempint == 1 && global.iv_selx > 0) global.iv_selx -= 1;
else if(tempint == 1 && global.iv_sely > 0) global.iv_sely -= 1;
else if(tempint == 2)
{
keyboard_key_press(vk_insert);
keyboard_key_release(vk_insert);
}
iv_formattable(iv_tabcol2db());
}";

}