SRL Archive - OSR Help

Script skips procedures


rj

2012-11-23 10:45:05

I made a semi-working auto fighter and I was wondering how to assign muiltiple numbers to one variable? Example: In my script i have
loot=14079706; 
But i want loot to be more then that, like

loot=14079706,1385128,8169399,1796428;  
How would i go about doing that?

Sin

2012-11-23 10:56:57

If..then
Begin
..
End

rj

2012-11-23 11:07:13

From: Shay
If..then
Begin
..
End


???

Rezozo

2012-11-23 11:35:02

He means use this format for if then statements^^^

Also, please learn the correct syntax and structure for Pascal. Do not declare a procedure inside a procedure (Procedure CheckCombat). Please take a look at the basics tuts on the forums.
I beg…
~Rez

rj

2012-11-23 12:49:06

New problem, the script runs, clicks the npc and loops but sometimes it does not right click the loot, and it does not click the bitmap at all!
program fite;
Var
X, Y, charm: Integer;
Const
// fill out
NPC=1122383;
loot=11908542;
tolerence=15;
time=7; // in seconds
rwait=1000;
tleft= 41;
tright = 44;
bleft=426;
bright=280;
// hitbar
hpx1=242;
hpy1=159;
hpx2=296;
hpy2=165;
hpcol=50036;


Procedure carmmap;
Begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');

End;
Procedure Freecharm;
Begin
FreeBitMap(charm);
End;
procedure pickup;
Begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
FindColorTolerance(X,Y,11185078,225,132,323,220,15)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_right)
wait(1000);
If FindBitMapToleranceIn(charm, X, Y,248, 197, 270, 214, 65) Then
Begin
WriteLn('LOOTCHARM');
movemouse(X, Y);
ClickMouse(X, Y, Mouse_left)
wait(3000);
End Else
WriteLn('Debug: We Could Not Find The charm');
End;
procedure checkcombat;
begin
Wait((time*1000) + Random(rwait));
pickup;
end;
procedure clicknpc;
var
X, Y, charm: Integer;
begin // kill npc
FindColorTolerance(X,Y,NPC,tleft,tright,bleft,bright,tolerence)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_Left)
checkcombat;
End;
begin
repeat
clicknpc;
Freecharm;
until (False);
end.

Neodymium

2012-11-23 13:17:10

ClickMouse(X, Y, Mouse_Left)
You forgot the semicolon at the end of that line.

Enslaved

2012-11-27 18:39:31

From: rjj95
New problem, the script runs, clicks the npc and loops but sometimes it does not right click the loot, and it does not click the bitmap at all!
program fite;
Var
X, Y, charm: Integer;
Const
// fill out
NPC=1122383;
loot=11908542;
tolerence=15;
time=7; // in seconds
rwait=1000;
tleft= 41;
tright = 44;
bleft=426;
bright=280;
// hitbar
hpx1=242;
hpy1=159;
hpx2=296;
hpy2=165;
hpcol=50036;


Procedure carmmap;
Begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');

End;
Procedure Freecharm;
Begin
FreeBitMap(charm);
End;
procedure pickup;
Begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
FindColorTolerance(X,Y,11185078,225,132,323,220,15)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_right)
wait(1000);
If FindBitMapToleranceIn(charm, X, Y,248, 197, 270, 214, 65) Then
Begin
WriteLn('LOOTCHARM');
movemouse(X, Y);
ClickMouse(X, Y, Mouse_left)
wait(3000);
End Else
WriteLn('Debug: We Could Not Find The charm');
End;
procedure checkcombat;
begin
Wait((time*1000) + Random(rwait));
pickup;
end;
procedure clicknpc;
var
X, Y, charm: Integer;
begin // kill npc
FindColorTolerance(X,Y,NPC,tleft,tright,bleft,bright,tolerence)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_Left)
checkcombat;
End;
begin
repeat
clicknpc;
Freecharm;
until (False);
end.

is the bitmap always found?
also put a delay after you move your mouse and before it clicks
From: Neodymium
ClickMouse(X, Y, Mouse_Left)
You forgot the semicolon at the end of that line.

he said it works some times

Rezozo

2012-11-27 18:52:06

I wonder if he ever got this resolved…
Im guessing it just didn't find that specific charm? Thus it looks like it 'sometimes' clicked?
~Rez

Daniel

2012-11-27 21:46:10

From: rjj95
how to assign muiltiple numbers to one variable? Example: In my script i have


See arrays. Off-site tutorials which may be of additional assistance may be this one and this one. :)