SRL Archive - OSR Help

i want to make a rsps bot for killing ghosts


remember me

2012-10-30 16:45:45

i got this code:
program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var
HealthBar, X, Y: Integer;
begin
HealthBar := DTMFromString('mrAAAAHic42BABaZQLAPFZkDMDMRsSGrYkPhguQkMDEJCQjjxfwb8gJEAhgEAlDEEEA==');
repeat
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
Wait(300)
end
Else
begin
if findcolortolerance(x, y, 11119020, MSX1, MSY1, MSX2, MSY2, 10) then
Begin
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
End;
until False;
FreeDTM(HealthBar);
end;

begin
setupsrl;
AttackMonster;
end.
i get this error:
[Hint] C:\Program Files (x86)\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54
Compiled successfully in 515 ms.

and i want that the clicker waits a littlebit longer because if it keeps clicking
it get the good place then i clicks on another place and then your man
starts to walk away from the monster and that doesn't work

Laimonas171

2012-10-30 17:23:55

From: remember me
i got this code:
program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var
HealthBar, X, Y: Integer;
begin
HealthBar := DTMFromString('mrAAAAHic42BABaZQLAPFZkDMDMRsSGrYkPhguQkMDEJCQjjxfwb8gJEAhgEAlDEEEA==');
repeat
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
Wait(300)
end
Else
begin
if findcolortolerance(x, y, 11119020, MSX1, MSY1, MSX2, MSY2, 10) then
Begin
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
End;
until False;
FreeDTM(HealthBar);
end;

begin
setupsrl;
AttackMonster;
end.
i get this error:
[Hint] C:\Program Files (x86)\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54
Compiled successfully in 515 ms.

and i want that the clicker waits a littlebit longer because if it keeps clicking
it get the good place then i clicks on another place and then your man
starts to walk away from the monster and that doesn't work


ignore that, it's nothing special, you still can run your script with that. pretty sure they will fix that at next revision

Nexz

2012-10-30 18:30:34

Nothing to worry about the unused variable

remember me

2013-01-19 18:13:55

From: remember me
i got this code:
program GhostKilling;
{$i srl/srl.simba}
procedure AttackMonster;
var
HealthBar, X, Y: Integer;
begin
HealthBar := DTMFromString('mrAAAAHic42BABaZQLAPFZkDMDMRsSGrYkPhguQkMDEJCQjjxfwb8gJEAhgEAlDEEEA==');
repeat
If FindDtm(HealthBar, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
Wait(300)
end
Else
begin
if findcolortolerance(x, y, 11119020, MSX1, MSY1, MSX2, MSY2, 10) then
Begin
MMouse(x, y, 5, 5);
wait(randomrange(200, 500));
ClickMouse2(mouse_Left)
end;
End;
until False;
FreeDTM(HealthBar);
end;

begin
setupsrl;
AttackMonster;
end.
i get this error:
[Hint] C:\Program Files (x86)\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54
Compiled successfully in 515 ms.

and i want that the clicker waits a littlebit longer because if it keeps clicking
it get the good place then i clicks on another place and then your man
starts to walk away from the monster and that doesn't work


can you maybe help me with that last part?

doxin

2013-01-20 19:32:15

From: remember me
can you maybe help me with that last part?


use Wait() function and use findcolorspiraltolerance so it can search for the nearest ghost.

remember me

2013-01-21 10:16:50

do i have to set the middle of the screen or something?

doxin

2013-01-22 23:37:43

From: remember me
do i have to set the middle of the screen or something?


yes. find the coordinates for where your character stands, ie. the middle of the screen, then do
var
MiddleScreenX := x coordinate
MiddleScreenY := y coordinate
then you can use
FindColorSpiralTolerance(MiddleScreenX, MiddleScreenY, blahblahblah);