Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnEvent(event, arg)
- --OutputLogMessage("event = %s, arg = %s\n", event, arg);
- l4dmode = false
- scmode = true
- tlmode = false
- if (l4dmode == true) then
- if (event == "G_PRESSED" and arg == 13) then
- zombies();
- end
- --Print a number range
- if (event == "G_PRESSED" and arg == 16) then
- ClearLCD();
- --WinFireWallRules();
- --loop_action();
- sb_health();
- end
- if (event == "G_PRESSED" and arg == 12) then
- test("v");
- end
- if (event == "G_PRESSED" and arg == 15) then
- test("v");
- end
- -- Print a string
- if (event == "G_PRESSED" and arg == 17) then
- ClearLCD();
- end
- if (event == "G_PRESSED" and arg == 18) then
- melee();
- end
- end
- if (scmode == true) then
- if (event == "G_PRESSED" and arg == 6) then
- move_to(1,4);
- end
- if (event == "G_PRESSED" and arg == 9) then
- attack_to(1,4);
- end
- if (event == "G_PRESSED" and arg == 14) then
- attack_to(1,2);
- end
- if (event == "G_PRESSED" and arg == 17) then
- attack_to(3,4);
- end
- if (event == "G_PRESSED" and arg == 15) then
- move_to(1,2);
- end
- if (event == "G_PRESSED" and arg == 18) then
- move_to(3,4);
- end
- end
- if (tlmode == true) then
- if (event == "G_PRESSED" and arg == 15) then
- minions_spawn();
- end
- end
- end
- function minions_spawn()
- OutputLogMessage("spawn!");
- OutputLCDMessage("spawn!\n");
- PlayMacro("torchlight skeletons");
- --PressAndReleaseKey("7");
- Sleep(12000);
- OutputLCDMessage("spawn done!\n");
- --PressAndReleaseMouseButton(3);
- Sleep(500);
- end
- function minions_constant()
- hmm = GetMKeyState();
- count = 0
- while hmm < 2 do
- count = count + 1
- --OutputLogMessage("sb_bot help! # %s\n",count);
- PressAndReleaseKey("7");
- Sleep(30000);
- hmm = GetMKeyState();
- end
- end
- function move_to(low, high)
- cur = low;
- while cur <= high do
- TypeOutString(cur);
- --Sleep(100);
- PressAndReleaseMouseButton(3);
- --OutputLogMessage("typing: %s\n",cur);
- --Sleep(1000);
- cur = cur + 1;
- end
- end
- function attack_to(low, high)
- cur = low;
- while cur <= high do
- TypeOutString(cur);
- TypeOutString("a");
- Sleep(40);
- PressAndReleaseMouseButton(1);
- Sleep(40);
- cur = cur + 1;
- end
- end
- function foo()
- print("foo", 1)
- coroutine.yield()
- print("foo", 2)
- end
- function test(cmd)
- px = 45;
- delay = 25;
- --3x3, start at top left
- MoveMouseRelative(px*-1,px*-1);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px,0);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px,0);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(0,px);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px*-1,0);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px*-1,0);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(0,px);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px,0);
- Sleep(delay);
- TypeOutString(cmd);
- MoveMouseRelative(px,0);
- Sleep(delay);
- TypeOutString(cmd);
- --MoveMouseRelative(px,0);
- --TypeOutString(cmd);
- --MoveMouseRelative(px,0);
- end
- function melee()
- hmm = GetMKeyState();
- while hmm < 2 do
- --OutputLogMessage("sb_bot help! # %s\n",'hmm');
- PressKey("F11");
- Sleep(50);
- ReleaseKey("F11");
- Sleep(100);
- PressAndReleaseKey("F12");
- Sleep(20);
- --MoveMouseRelative(-800,0);
- --PressAndReleaseKey("3");
- --Sleep(250);
- hmm = GetMKeyState();
- end
- end
- function nb_rush()
- hmm = GetMKeyState();
- count = 0
- while hmm < 2 do
- count = count + 1
- OutputLogMessage("sb_bot help! # %s\n",count);
- PressAndReleaseKey("F12");
- Sleep(30000);
- hmm = GetMKeyState();
- end
- end
- function sb_health()
- hmm = GetMKeyState();
- count = 0
- while hmm < 2 do
- count = count + 1
- OutputLogMessage("sb_bot help! # %s\n",count);
- PressAndReleaseKey("k");
- Sleep(30000);
- hmm = GetMKeyState();
- end
- end
- function zombies()
- hmm = GetMKeyState();
- count = 0
- while hmm < 2 do
- count = count + 1
- OutputLogMessage("adding zombie! # %s\n",count);
- PressAndReleaseKey("9");
- Sleep(300);
- hmm = GetMKeyState();
- end
- end
- function loop_action()
- hmm = GetMKeyState();
- count = 0
- while hmm < 2 do
- count = count + 1
- OutputLogMessage("adding bot # %s\n",count);
- PressAndReleaseKey("9");
- Sleep(100);
- hmm = GetMKeyState();
- end
- end
- function WinFireWallRules()
- for i = 125, 130, 1 do
- AbortMacro();
- PlayMacro("ftp1"); -- alt+o,tab,enter / open 'add port...'
- Sleep(1200);
- TypeOutString("ftp ");
- TypeOutString(i);
- TypeOutString(" tcp");
- Sleep(1000);
- TypeOutString(i);
- Sleep(2000);
- end
- end
- function TypeOutString(typeString)
- for i=0,string.len(typeString) do
- char = string.sub(typeString, i, i);
- OutputLogMessage(char .. "\n" );
- if(char == " " ) then
- char = "spacebar";
- elseif(char == "," ) then
- char = "comma";
- elseif(char == "." ) then
- char = "period";
- elseif(char == "!" ) then
- PressKey("lshift" );
- PressAndReleaseKey("1" );
- ReleaseKey("lshift" );
- return;
- elseif(char == "'" ) then
- char = "quote";
- end
- PressAndReleaseKey(char);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement