{
  "actions": [
    {
      "actionId": 603,
      "appliesTo": -1,
      "argTypes": [
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "argValues": [
        "if(!instance_exists(iv_backdraw))\r\n{\r\n\r\n\r\n\r\nif(global.selectid == 0)\r\n{\r\n\r\nif(global.mb_level == 0)\r\n{\r\nglobal.mbout = 0;\r\ninstance_destroy();\r\n}\r\nelse if(global.mb_level == 1 || global.mb_level == 3)\r\n{\r\nif(global.mb_level != 1) keyboard_string = \"\";\r\nglobal.mb_level = 0;\r\n}\r\nelse if(global.mb_level == 2 || global.mb_level == 4 || global.mb_level == 5 || global.mb_level == 6)\r\n{\r\nif(global.mb_level != 2) keyboard_string = \"\";\r\nglobal.mb_level = 1;\r\n}\r\n\r\n}\r\n\r\n\r\nelse if(global.selectid == 1)\r\n{\r\n\r\nif(global.mb_level == 0)\r\n{\r\nglobal.rselectid = 0;\r\nglobal.mb_ctopic = global.mb_ctindex[global.tselectid+global.mbttopline];\r\nglobal.mbrtopline = global.mb_topic[global.mb_ctopic,1]-1;\r\nglobal.mb_level = 1;\r\n}\r\nelse if(global.mb_level == 1)\r\n{\r\nif(global.rselectid > 0)\r\n{\r\nglobal.mb_creply = global.mbrtopline-(global.rselectid-1);\r\n}\r\nglobal.mb_level = 2;\r\n}\r\nelse if(global.mb_level == 2)\r\n{\r\nevent_perform(ev_other,ev_user0);\r\n}\r\nelse if(global.mb_level == 3)\r\n{\r\nglobal.mb_topic[global.mb_total[1],0] = global.playername + \"[\" + global.mb_ntemptitle + \"]\" + global.mb_ntempbody;\r\nglobal.mb_topic[global.mb_total[1],2] = global.mb_cboard;\r\n//Send this new topic to the server:\r\nclearbuffer();\r\nwritebyte(11);\r\nwriteint(global.mb_cboard);\r\nwritestring(global.mb_topic[global.mb_total[1],0]);\r\nsendmessage(global.s_tcpsocket);\r\nglobal.mb_total[1] += 1;\r\nkeyboard_string = \"\";\r\nglobal.tselectid = 0;\r\nglobal.mbttopline = -1;\r\nglobal.mb_level = 0;\r\n}\r\nelse if(global.mb_level == 4)\r\n{\r\nglobal.mb_reply[global.mb_ctopic,global.mb_topic[global.mb_ctopic,1]] = global.playername + \"[\" + global.mb_ntemptitle + \"]\" + global.mb_ntempbody;\r\n//Send this new reply to the server:\r\nclearbuffer();\r\nwritebyte(12);\r\nwriteint(global.mb_ctopic);\r\nwritestring(global.mb_reply[global.mb_ctopic,global.mb_topic[global.mb_ctopic,1]]);\r\nsendmessage(global.s_tcpsocket);\r\nglobal.mb_topic[global.mb_ctopic,1] += 1;\r\nkeyboard_string = \"\";\r\nglobal.rselectid = 0;\r\nglobal.mbrtopline = global.mb_topic[global.mb_ctopic,1]-1;\r\nglobal.mb_ctopic = mb_trise(global.mb_ctopic);\r\nglobal.mb_level = 1;\r\n}\r\nelse if(global.mb_level == 5)\r\n{\r\nglobal.mb_topic[global.mb_ctopic,0] = mb_getwriter(global.mb_topic[global.mb_ctopic,0]) + \"[\" + global.mb_ntemptitle + \"]\" + global.mb_ntempbody;\r\n//global.mb_topic[global.mb_ctopic,2] = global.mb_cboard;\r\n//Send the editted topic to the server:\r\nclearbuffer();\r\nwritebyte(6);\r\nwriteint(global.mb_ctopic);\r\nwritestring(global.mb_topic[global.mb_ctopic,0]);\r\nsendmessage(global.s_tcpsocket);\r\nkeyboard_string = \"\";\r\nglobal.mb_level = 1;\r\n}\r\nelse if(global.mb_level == 6)\r\n{\r\nglobal.mb_reply[global.mb_ctopic,global.mb_creply] = mb_getwriter(global.mb_reply[global.mb_ctopic,global.mb_creply]) + \"[\" + global.mb_ntemptitle + \"]\" + global.mb_ntempbody;\r\n//Send the editted reply to the server:\r\nclearbuffer();\r\nwritebyte(7);\r\nwriteint(global.mb_ctopic);\r\nwriteint(global.mb_creply);\r\nwritestring(global.mb_reply[global.mb_ctopic,global.mb_creply]);\r\nsendmessage(global.s_tcpsocket);\r\nkeyboard_string = \"\";\r\nglobal.mb_level = 1;\r\n}\r\n\r\n}\r\n\r\n\r\nelse if(global.selectid == 2)\r\n{\r\n\r\nif(global.mb_level == 0)\r\n{\r\nglobal.mb_level = 3;\r\nglobal.nselectid = 0;\r\nkeyboard_string = \"Enter Topic Title\";\r\nglobal.mb_ntempbody = \"Enter the topic's body text.\";\r\n}\r\nelse if(global.mb_level == 1)\r\n{\r\nglobal.mb_level = 4;\r\nglobal.nselectid = 0;\r\nkeyboard_string = \"Enter Reply Title\";\r\nglobal.mb_ntempbody = \"Enter the reply's body text.\";\r\n}\r\nelse if(global.mb_level == 2)\r\n{\r\nclipboard_set_text(global.mb_creplytext);\r\nif(global.rselectid > 0)\r\n{\r\ncaddline(\"The topic reply titled '\" + mb_getname(global.mb_reply[global.mb_ctopic,global.mb_creply]) + \"', written by \" + mb_getwriter(global.mb_reply[global.mb_ctopic,global.mb_creply]) + \", has been copied to your clipboard.\",global.c_server);\r\n}\r\nelse\r\n{\r\ncaddline(\"The topic message titled '\" + mb_getname(global.mb_topic[global.mb_ctopic,0]) + \"', written by \" + mb_getwriter(global.mb_topic[global.mb_ctopic,0]) + \", has been copied to your clipboard.\",global.c_server);\r\n}\r\n}\r\nelse if(global.mb_level == 5)\r\n{\r\n//Delete this topic:\r\nclearbuffer();\r\nwritebyte(19);\r\nwritebyte(0);\r\nwriteint(global.mb_ctopic);\r\nsendmessage(global.s_tcpsocket);\r\nkeyboard_string = \"\";\r\nglobal.mb_level = 0;\r\nmb_tcollapse(global.mb_ctopic);\r\n//Send a request for a board string and topic update for this board:\r\nclearbuffer();\r\nwritebyte(13);\r\nwritebyte(global.clientid);\r\nwriteint(global.mb_cboard);\r\nsendmessage(global.s_tcpsocket);\r\n}\r\nelse if(global.mb_level == 6)\r\n{\r\n//Delete this reply:\r\nclearbuffer();\r\nwritebyte(19);\r\nwritebyte(1);\r\nwriteint(global.mb_ctopic);\r\nwriteint(global.mb_creply);\r\nsendmessage(global.s_tcpsocket);\r\nkeyboard_string = \"\";\r\nglobal.mb_level = 1;\r\nmb_rcollapse(global.mb_ctopic,global.mb_creply);\r\n//Send a request for a topic replies update:\r\nclearbuffer();\r\nwritebyte(14);\r\nwriteint(global.mb_ctopic);\r\nsendmessage(global.s_tcpsocket);\r\n}\r\n\r\n}\r\n\r\n\r\nelse if(global.selectid == 3)\r\n{\r\n\r\nif(global.mb_level == 0)\r\n{\r\n//Send a request for a board string and topic update for this board:\r\nclearbuffer();\r\nwritebyte(13);\r\nwriteint(global.mb_cboard);\r\nsendmessage(global.s_tcpsocket);\r\n}\r\nelse if(global.mb_level == 1)\r\n{\r\n//Send a request for a topic replies update:\r\nclearbuffer();\r\nwritebyte(14);\r\nwriteint(global.mb_ctopic);\r\nsendmessage(global.s_tcpsocket);\r\n}\r\nelse if(global.mb_level == 2)\r\n{\r\n\r\nglobal.nselectid = 1;\r\nkeyboard_string = global.mb_creplytext;\r\nglobal.mb_ntempbody = global.mb_creplytext;\r\nif(global.rselectid == 0)\r\n{\r\nglobal.mb_ntemptitle = mb_getname(global.mb_topic[global.mb_ctopic,0]);\r\nglobal.mb_level = 5;\r\n}\r\nelse\r\n{\r\nglobal.mb_ntemptitle = mb_getname(global.mb_reply[global.mb_ctopic,global.mb_creply]);\r\nglobal.mb_level = 6;\r\n}\r\n\r\n}\r\n\r\n}\r\n\r\n\r\n\r\nif(global.mb_level == 0)\r\n{\r\n//Send a request for a board string and topic update for this board:\r\nclearbuffer();\r\nwritebyte(13);\r\nwriteint(global.mb_cboard);\r\nsendmessage(global.s_tcpsocket);\r\nglobal.selectid = 1;\r\nglobal.cselmax = 4;\r\nselectiontext[0] = \"Leave Board\";\r\nselectiontext[1] = \"View Topic\";\r\nselectiontext[2] = \"New Topic\";\r\nselectiontext[3] = \"Refresh\";\r\n}\r\nelse if(global.mb_level == 1)\r\n{\r\n//Send a request for a topic replies update:\r\nclearbuffer();\r\nwritebyte(14);\r\nwriteint(global.mb_ctopic);\r\nsendmessage(global.s_tcpsocket);\r\nglobal.selectid = 1;\r\nglobal.cselmax = 4;\r\nselectiontext[0] = \"Back to Topics\";\r\nselectiontext[1] = \"Show Post\";\r\nselectiontext[2] = \"New Reply\";\r\nselectiontext[3] = \"Refresh\";\r\n}\r\nelse if(global.mb_level == 2)\r\n{\r\nglobal.selectid = 0;\r\nif((mb_getwriter(global.mb_topic[global.mb_ctopic,0]) == global.playername && global.rselectid == 0) ||\r\n   (mb_getwriter(global.mb_reply[global.mb_ctopic,global.mb_creply]) == global.playername && global.rselectid > 0) ||\r\n    mb_getwriter(global.mb_board[global.mb_cboard]) == global.playername || iv_itemsearch(1,\"907\") > 0)\r\nglobal.cselmax = 4;\r\nelse global.cselmax = 3;\r\nselectiontext[0] = \"Back to Replies\";\r\nselectiontext[1] = \"Go To A Link\";\r\nselectiontext[2] = \"Copy Post\";\r\nselectiontext[3] = \"Edit Post\";\r\n}\r\nelse if(global.mb_level == 3)\r\n{\r\nglobal.selectid = 1;\r\nglobal.cselmax = 2;\r\nselectiontext[0] = \"Cancel Post\";\r\nselectiontext[1] = \"Post Topic\";\r\n}\r\nelse if(global.mb_level == 4)\r\n{\r\nglobal.selectid = 1;\r\nglobal.cselmax = 2;\r\nselectiontext[0] = \"Cancel Post\";\r\nselectiontext[1] = \"Post Reply\";\r\n}\r\nelse if(global.mb_level == 5)\r\n{\r\nglobal.selectid = 1;\r\nglobal.cselmax = 3;\r\nselectiontext[0] = \"Cancel Edit\";\r\nselectiontext[1] = \"Submit Changes\";\r\nselectiontext[2] = \"Delete Topic\";\r\n}\r\nelse if(global.mb_level == 6)\r\n{\r\nglobal.selectid = 1;\r\nglobal.cselmax = 3;\r\nselectiontext[0] = \"Cancel Edit\";\r\nselectiontext[1] = \"Submit Changes\";\r\nselectiontext[2] = \"Delete Reply\";\r\n}\r\n\r\n\r\n\r\n}"
      ],
      "isRelative": false
    }
  ],
  "eventNumber": 35,
  "eventType": 9
}
