Advertisement
Corosus

@_@

Jun 15th, 2012
1,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.16 KB | None | 0 0
  1. function OnEvent(event, arg)
  2.     --OutputLogMessage("event = %s, arg = %s\n", event, arg);
  3.  
  4.  
  5.  
  6.     l4dmode = false
  7.     scmode = true
  8.     tlmode = false
  9.  
  10.  
  11.  
  12.     if (l4dmode == true) then
  13.         if (event == "G_PRESSED" and arg == 13) then
  14.             zombies();
  15.         end
  16.  
  17.         --Print a number range
  18.         if (event == "G_PRESSED" and arg == 16) then
  19.             ClearLCD();
  20.  
  21.             --WinFireWallRules();
  22.             --loop_action();
  23.             sb_health();
  24.         end
  25.  
  26.         if (event == "G_PRESSED" and arg == 12) then
  27.             test("v");
  28.         end
  29.         if (event == "G_PRESSED" and arg == 15) then
  30.             test("v");
  31.         end
  32.         -- Print a string
  33.         if (event == "G_PRESSED" and arg == 17) then
  34.             ClearLCD();
  35.         end
  36.  
  37.         if (event == "G_PRESSED" and arg == 18) then
  38.             melee();
  39.         end
  40.     end
  41.  
  42.     if (scmode == true) then
  43.  
  44.         if (event == "G_PRESSED" and arg == 6) then
  45.             move_to(1,4);
  46.         end
  47.  
  48.         if (event == "G_PRESSED" and arg == 9) then
  49.             attack_to(1,4);
  50.         end
  51.  
  52.         if (event == "G_PRESSED" and arg == 14) then
  53.             attack_to(1,2);
  54.         end
  55.  
  56.         if (event == "G_PRESSED" and arg == 17) then
  57.             attack_to(3,4);
  58.         end
  59.  
  60.         if (event == "G_PRESSED" and arg == 15) then
  61.             move_to(1,2);
  62.         end
  63.         if (event == "G_PRESSED" and arg == 18) then
  64.             move_to(3,4);
  65.         end
  66.     end
  67.  
  68.     if (tlmode == true) then
  69.         if (event == "G_PRESSED" and arg == 15) then
  70.             minions_spawn();
  71.         end
  72.  
  73.  
  74.     end
  75. end
  76.  
  77. function minions_spawn()
  78.    
  79.    
  80.  
  81.     OutputLogMessage("spawn!");
  82.     OutputLCDMessage("spawn!\n");
  83.     PlayMacro("torchlight skeletons");
  84.     --PressAndReleaseKey("7");
  85.     Sleep(12000);
  86.     OutputLCDMessage("spawn done!\n");
  87.     --PressAndReleaseMouseButton(3);
  88.     Sleep(500);
  89.    
  90. end
  91.  
  92. function minions_constant()
  93.     hmm = GetMKeyState();
  94.     count = 0
  95.     while hmm < 2 do
  96.         count = count + 1
  97.         --OutputLogMessage("sb_bot help! # %s\n",count);
  98.         PressAndReleaseKey("7");
  99.         Sleep(30000);
  100.         hmm = GetMKeyState();
  101.     end
  102. end
  103.  
  104. function move_to(low, high)
  105.     cur = low;
  106.     while cur <= high do
  107.         TypeOutString(cur);
  108.         --Sleep(100);
  109.         PressAndReleaseMouseButton(3);
  110.         --OutputLogMessage("typing: %s\n",cur);
  111.         --Sleep(1000);
  112.         cur = cur + 1;
  113.     end
  114. end
  115.  
  116. function attack_to(low, high)
  117.     cur = low;
  118.     while cur <= high do
  119.         TypeOutString(cur);
  120.        
  121.         TypeOutString("a");
  122.         Sleep(40);
  123.         PressAndReleaseMouseButton(1);
  124.         Sleep(40);
  125.         cur = cur + 1;
  126.     end
  127. end
  128.  
  129. function foo()
  130.    print("foo", 1)
  131.    coroutine.yield()
  132.    print("foo", 2)
  133. end
  134.  
  135. function test(cmd)
  136.     px = 45;
  137.     delay = 25;
  138.     --3x3, start at top left
  139.     MoveMouseRelative(px*-1,px*-1);
  140.     Sleep(delay);
  141.     TypeOutString(cmd);
  142.  
  143.     MoveMouseRelative(px,0);
  144.     Sleep(delay);
  145.     TypeOutString(cmd);
  146.  
  147.     MoveMouseRelative(px,0);
  148.     Sleep(delay);
  149.     TypeOutString(cmd);
  150.  
  151.     MoveMouseRelative(0,px);
  152.     Sleep(delay);
  153.     TypeOutString(cmd);
  154.  
  155.     MoveMouseRelative(px*-1,0);
  156.     Sleep(delay);
  157.     TypeOutString(cmd);
  158.  
  159.     MoveMouseRelative(px*-1,0);
  160.     Sleep(delay);
  161.     TypeOutString(cmd);
  162.  
  163.     MoveMouseRelative(0,px);
  164.     Sleep(delay);
  165.     TypeOutString(cmd);
  166.  
  167.     MoveMouseRelative(px,0);
  168.     Sleep(delay);
  169.     TypeOutString(cmd);
  170.  
  171.     MoveMouseRelative(px,0);
  172.     Sleep(delay);
  173.     TypeOutString(cmd);
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.     --MoveMouseRelative(px,0);
  191.     --TypeOutString(cmd);
  192.     --MoveMouseRelative(px,0);
  193.    
  194. end
  195.  
  196. function melee()
  197.     hmm = GetMKeyState();
  198.     while hmm < 2 do
  199.         --OutputLogMessage("sb_bot help! # %s\n",'hmm');        
  200.         PressKey("F11");
  201.         Sleep(50);
  202.         ReleaseKey("F11");
  203.         Sleep(100);
  204.         PressAndReleaseKey("F12");
  205.         Sleep(20);
  206.         --MoveMouseRelative(-800,0);
  207.         --PressAndReleaseKey("3");
  208.         --Sleep(250);
  209.         hmm = GetMKeyState();
  210.     end
  211. end
  212.  
  213. function nb_rush()
  214.     hmm = GetMKeyState();
  215.     count = 0
  216.     while hmm < 2 do
  217.         count = count + 1
  218.         OutputLogMessage("sb_bot help! # %s\n",count);
  219.         PressAndReleaseKey("F12");
  220.         Sleep(30000);
  221.         hmm = GetMKeyState();
  222.     end
  223. end
  224.  
  225. function sb_health()
  226.     hmm = GetMKeyState();
  227.     count = 0
  228.     while hmm < 2 do
  229.         count = count + 1
  230.         OutputLogMessage("sb_bot help! # %s\n",count);
  231.         PressAndReleaseKey("k");
  232.         Sleep(30000);
  233.         hmm = GetMKeyState();
  234.     end
  235. end
  236.  
  237. function zombies()
  238.     hmm = GetMKeyState();
  239.     count = 0
  240.     while hmm < 2 do
  241.         count = count + 1
  242.         OutputLogMessage("adding zombie! # %s\n",count);
  243.         PressAndReleaseKey("9");
  244.         Sleep(300);
  245.         hmm = GetMKeyState();
  246.     end
  247. end
  248.  
  249. function loop_action()
  250.     hmm = GetMKeyState();
  251.     count = 0
  252.     while hmm < 2 do
  253.         count = count + 1
  254.         OutputLogMessage("adding bot # %s\n",count);
  255.         PressAndReleaseKey("9");
  256.         Sleep(100);
  257.         hmm = GetMKeyState();
  258.     end
  259. end
  260.  
  261. function WinFireWallRules()
  262.     for i = 125, 130, 1 do
  263.         AbortMacro();
  264.         PlayMacro("ftp1"); -- alt+o,tab,enter / open 'add port...'
  265.         Sleep(1200);
  266.         TypeOutString("ftp ");
  267.         TypeOutString(i);
  268.         TypeOutString(" tcp");
  269.         Sleep(1000);
  270.         TypeOutString(i);
  271.         Sleep(2000);
  272.     end
  273. end
  274.  
  275. function TypeOutString(typeString)
  276.     for i=0,string.len(typeString) do
  277.         char = string.sub(typeString, i, i);
  278.         OutputLogMessage(char .. "\n" );
  279.         if(char == " " ) then
  280.             char = "spacebar";
  281.         elseif(char == "," ) then
  282.             char = "comma";
  283.         elseif(char == "." ) then
  284.             char = "period";
  285.         elseif(char == "!" ) then
  286.             PressKey("lshift" );
  287.             PressAndReleaseKey("1" );
  288.             ReleaseKey("lshift" );
  289.             return;
  290.         elseif(char == "'" ) then
  291.             char = "quote";
  292.         end
  293.         PressAndReleaseKey(char);
  294.     end
  295. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement