Advertisement
Guest User

Untitled

a guest
May 10th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.95 KB | None | 0 0
  1. <?php
  2. require "../core.php"; // Includes Pickle's core.php, required core functions
  3. require "../tasks.php"; // Includes Pickle's tasks.php, simple game tasks
  4.  
  5. $Username = "Username";
  6. $Password = "Password";
  7. $Server = "Server";
  8. $TargetID = "Leader ID";
  9.  
  10.  
  11. if (connect($Server, $Username, $Password, true)) { //If it connects to the server do the following...
  12. echo ("Logged in succesfully\n"); // Show "Logged in succesfully" on the command line.
  13. findBuddy($TargetID); //Finds room that target is in.
  14.  
  15. $rawPack = readRawPacket(); //Sets a variable for recieved packets.
  16.  
  17. if (stripos($rawPack, "xt%bf%" . $myRoomID . "%")){ //If you get a recieved packet from finding the buddy...
  18. $Room = stribet($rawPack, "%xt%bf%$myRoomID%", "%"); //Set a variable for the room that they are in.
  19.  
  20. if (($Room < 900) and ($Room != $extRoomID)){ //If the room ID that they are in is less than 900 and is not the current room they are in...
  21. gotoRoom($Room, 0, 0); //Go to the rooom.
  22. echo("Found target in room $Room\n"); // Show it on the command line.
  23. }
  24. elseif (($Room >= 900) and ($Room < 1000)){ // Or if the room is equal to or greater than 900, but less than 1000...
  25. echo("Your target is in a game. Waiting for game to end...\n"); //Show it on the command line.
  26. sleep(5); // Waits five seconds.
  27. findBuddy($TargetID); // Searches for target again.
  28. }
  29. elseif (($Room > 999) and ($Room != $extRoomID)){ // Or if the room ID they are in is above 999 and is not the current room you are in
  30. gotoRoom($Room, 0, 0); // Go to the igloo.
  31. echo("Found target in Igloo #$Room\n"); //Shows it on the command line.
  32. }
  33. }
  34. }
  35.  
  36. while (true) {
  37. $rawPack = readRawPacket();
  38.  
  39. if (stripos($rawPack, "xt%sm%$myRoomID%$TargetID")){ // If you get a recieve packet of your target talking...
  40. $Message = stribet($rawPack, "%xt%sm%$myRoomID%$TargetID%", "%"); // Isolate the message and set it as a variable.
  41. say($Message); //Say the variable
  42. echo("Message: '$Message'\n"); //Show the message on the command line.
  43. }
  44.  
  45. elseif (stripos($rawPack, "xt%se%". $myRoomID . "%" . $TargetID)) { //Or if you get a recieve packet of your target performing an emote...
  46. $emoteID = stribet($rawPack, "%xt%se%$myRoomID%$TargetID%", "%"); // Isolate the emote ID and set it as a variable.
  47. sendEmote($emoteID); //Perform the emote.
  48. echo("Emote: $emoteID\n"); //Shows the emote Id on the command line.
  49. }
  50.  
  51. elseif (stripos($rawPack, "xt%sp%". $myRoomID . "%" . $TargetID)) { //Or if your target switches its position...
  52. $x = stribet($rawPack, "%xt%sp%$myRoomID%$TargetID%", "%") + 20; //Isolate their x coordiante and set it as a variable with an offset of +20.
  53. $y = stribet($rawPack, "%xt%sp%$myRoomID%$TargetID%$x%", "%"); //Isolate their y coordinate and set it as a variable.
  54. goto($x, $y); //Walk to $x, $y.
  55. echo("Position: $x, $y\n"); // Show position on the command line.
  56. }
  57.  
  58. elseif (stripos($rawPack, "xt%sb%". $myRoomID . "%" . $TargetID)) { //Or if your target throws a snowball...
  59. $x = stribet($rawPack, "%xt%sb%$myRoomID%$TargetID%", "%") + 20; //Isolate their x coordinate and set it as a variable with an offset of +20
  60. $y = stribet($rawPack, "%xt%sb%$myRoomID%$TargetID%$x%", "%"); //Isolate their y coordinate and set it as a variable.
  61. snowBall($x, $y); //Throw a snowball at $x, $y.
  62. echo("Snowball: $x, $y\n"); //Shows your snowball coords on the command line.
  63. }
  64.  
  65. elseif (stripos($rawPack, "xt%ss%". $myRoomID . "%" . $TargetID)) { //Or if your target sends a safe chat message...
  66. $SafeMessage = stribet($rawPack, "%xt%ss%$myRoomID%$TargetID%", "%"); //Isolate the message and set it as a variable.
  67. safeMessage($MessageID); //Send the safe chat message.
  68. echo("Safe Chat: $SafeMessage\n"); //Show the safe chat message in the command line.
  69. }
  70.  
  71. elseif (stripos($rawPack, "xt%rp%-1%" . $TargetID)) { //Or if your target leaves the room...
  72. findBuddy($TargetID); //Find the target...
  73. echo("Target left, finding target...\n"); //Show that they left on the command line.
  74. }
  75. if (stripos($rawPack, "xt%bf%" . $myRoomID . "%")){ //If you get a recieved packet from finding the buddy...
  76. $Room = stribet($rawPack, "%xt%bf%$myRoomID%", "%"); //Set a variable for the room that they are in.
  77.  
  78. if (($Room < 900) and ($Room != $extRoomID)){ //If the room ID that they are in is less than 900 and is not the current room they are in...
  79. gotoRoom($Room, 0, 0); //Go to the rooom.
  80. echo("Found target in room $Room\n"); // Show it on the command line.
  81. }
  82. elseif (($Room >= 900) and ($Room < 1000)){ // Or if the room is equal to or greater than 900, but less than 1000...
  83. echo("Your target is in a game. Waiting for game to end...\n"); //Show it on the command line.
  84. sleep(5); // Waits five seconds.
  85. findBuddy($TargetID); // Searches for target again.
  86. }
  87. elseif (($Room > 999) and ($Room != $extRoomID)){ // Or if the room ID they are in is above 999 and is not the current room you are in
  88. gotoRoom($Room, 0, 0); // Go to the igloo.
  89. echo("Found target in Igloo #$Room\n"); //Shows it on the command line.
  90. }
  91. }
  92.  
  93. elseif (stripos($rawPack, "xt%sa%" . $myRoomID . "%" . $TargetID)) { //Or if your target performs an action...
  94. $ActionID = stribet($rawPack, "%xt%sa%$myRoomID%$TargetID%", "%"); //Isolate the action ID and set it as a variable.
  95. sendAction($ActionID); //Perform the action.
  96. echo("Action: $ActionID\n"); //Show the action ID on the command line.
  97. }
  98.  
  99. elseif (stripos($rawPack, "xt%upc%" . $myRoomID . "%" . $TargetID)) { //Or if your target changes its color...
  100. $ColorID = stribet($rawPack, "%xt%upc%$myRoomID%$TargetID%", "%"); //Isolate the ID of the color they put on and set it as a variable.
  101. updateColor($ColorID); //Change your color to theirs.
  102. echo("Color: $ColorID\n"); //Shows color change on the command line.
  103. }
  104.  
  105. elseif (stripos($rawPack, "xt%sf%" . $myRoomID . "%" . $TargetID)) { //Or if your target switches its frame...
  106. $FrameID = stribet($rawPack, "%xt%sf%$myRoomID%$TargetID%", "%"); //Isolate the frame ID and set it as a variable.
  107. sendFrame($FrameID); //Send the frame.
  108. echo("Frame: $FrameID\n"); //Show the frame on the command line.
  109. }
  110. }
  111. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement