Marc000z
10-05-2012, 09:08 PM
Fahk it, I'll just release it. Keep in mind there's still a bit of work to do regarding failsafes (Missclicks, delays, etc), but it does work for at least 10 consecutive runs.
PS. Number of lines was 152. ^^
program Dungeoneering;
{$i srl/srl.simba}
Const
LogCol = 7330283;
LobyCol = 1052691;
DMast = 3359857;
Door = 3632504;
NPC = 56797;
var
x, y, w, h: integer;
procedure Getclient;
begin
Movemouse(640, 185);
wait(1000);
Clickmouse(640, 185, mouse_Left);
wait(300);
end;
procedure Login;
begin
SetUpSRL
mousespeed := 20;
GetClientDimensions(w, h);
if FindColor(x, y, LogCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Logging in.');
wait(7000)
end;
end;
procedure camup;
begin
Keydown(38);
Wait(4000);
keyup(38);
end;
procedure lobby;
begin
GetClientDimensions(w, h);
if FindColor(x, y, LobyCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Leaving lobby.');
wait(7000)
end else
Keydown(37);
Wait(2000);
Keyup(37);
wait(200);
begin
GetClientDimensions(w, h);
if FindColor(x, y, LobyCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Leaving lobby.');
wait(7000)
end
end;
end;
procedure Dungmast;
begin
GetClientDimensions(w, h);
if FindColor(x, y, Dmast, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Getting new dungeon.');
wait(4000)
end;
end;
procedure Talk;
begin
Movemouse(250, 380);
wait(1000);
ClickMouse(250, 380, mouse_Left);
Wait(4000);
MoveMouse(260, 365);
wait(1000);
Clickmouse(260, 365, mouse_left);
Wait(10000);
Movemouse(610, 180);
Wait(200);
Clickmouse(610, 180, mouse_left);
end;
procedure Opdo;
begin
SetUpSRL
mousespeed := 20;
Keydown(37);
Wait(1800);
Keyup(37);
Keydown(40);
Wait(2000);
Keyup(40);
GetClientDimensions(w, h);
if FindColor(x, y, Door, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Going for door.');
wait(7000);
end;
end;
procedure fightnpc;
begin
GetClientDimensions(w, h);
if FindColor(x, y, NPC, 0, 0, w-1, h-1)then
begin
Wait(2000);
Mouse(x, y, 0, 0, True);
Writeln('Going to NPCs.');
wait(10000);
Movemouse(600, 200);
wait(10000);
Clickmouse(600, 200, mouse_left);
Wait(10000);
Clickmouse(600, 200, mouse_left);
Wait(10000);
end;
end;
procedure endgame;
begin
GetClientDimensions(w, h);
Movemouse(612, 385)
wait(10000);
clickmouse(612, 385, mouse_Left);
Wait(5000);
end;
begin
repeat
Cleardebug;
Getclient;
Login;
camup;
lobby;
Dungmast;
Talk;
OpDo;
fightnpc;
endgame;
until false
end.
http://www.youtube.com/watch?v=Jz7l0pRSPzc
PS. Number of lines was 152. ^^
program Dungeoneering;
{$i srl/srl.simba}
Const
LogCol = 7330283;
LobyCol = 1052691;
DMast = 3359857;
Door = 3632504;
NPC = 56797;
var
x, y, w, h: integer;
procedure Getclient;
begin
Movemouse(640, 185);
wait(1000);
Clickmouse(640, 185, mouse_Left);
wait(300);
end;
procedure Login;
begin
SetUpSRL
mousespeed := 20;
GetClientDimensions(w, h);
if FindColor(x, y, LogCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Logging in.');
wait(7000)
end;
end;
procedure camup;
begin
Keydown(38);
Wait(4000);
keyup(38);
end;
procedure lobby;
begin
GetClientDimensions(w, h);
if FindColor(x, y, LobyCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Leaving lobby.');
wait(7000)
end else
Keydown(37);
Wait(2000);
Keyup(37);
wait(200);
begin
GetClientDimensions(w, h);
if FindColor(x, y, LobyCol, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Leaving lobby.');
wait(7000)
end
end;
end;
procedure Dungmast;
begin
GetClientDimensions(w, h);
if FindColor(x, y, Dmast, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Getting new dungeon.');
wait(4000)
end;
end;
procedure Talk;
begin
Movemouse(250, 380);
wait(1000);
ClickMouse(250, 380, mouse_Left);
Wait(4000);
MoveMouse(260, 365);
wait(1000);
Clickmouse(260, 365, mouse_left);
Wait(10000);
Movemouse(610, 180);
Wait(200);
Clickmouse(610, 180, mouse_left);
end;
procedure Opdo;
begin
SetUpSRL
mousespeed := 20;
Keydown(37);
Wait(1800);
Keyup(37);
Keydown(40);
Wait(2000);
Keyup(40);
GetClientDimensions(w, h);
if FindColor(x, y, Door, 0, 0, w-1, h-1)then
begin
Mouse(x, y, 0, 0, True);
Writeln('Going for door.');
wait(7000);
end;
end;
procedure fightnpc;
begin
GetClientDimensions(w, h);
if FindColor(x, y, NPC, 0, 0, w-1, h-1)then
begin
Wait(2000);
Mouse(x, y, 0, 0, True);
Writeln('Going to NPCs.');
wait(10000);
Movemouse(600, 200);
wait(10000);
Clickmouse(600, 200, mouse_left);
Wait(10000);
Clickmouse(600, 200, mouse_left);
Wait(10000);
end;
end;
procedure endgame;
begin
GetClientDimensions(w, h);
Movemouse(612, 385)
wait(10000);
clickmouse(612, 385, mouse_Left);
Wait(5000);
end;
begin
repeat
Cleardebug;
Getclient;
Login;
camup;
lobby;
Dungmast;
Talk;
OpDo;
fightnpc;
endgame;
until false
end.
http://www.youtube.com/watch?v=Jz7l0pRSPzc