SRL Archive - OSR Help

This script gives me errors


rj

2012-11-22 23:24:04

check below for uptext.rar

riwu

2012-11-22 23:29:43

Assign an integer variable/handler to load the bitmap with BitmapFromString, then use that variable as the first parameter of FindBitmap. The second and third parameter are the point in which the bitmap is located (if found).

rj

2012-11-22 23:33:22

From: riwu
Assign an integer variable/handler to load the bitmap with BitmapFromString, then use that variable as the first parameter of FindBitmap. The second and third parameter are the point in which the bitmap is located (if found).


Could you give me an example

Rezozo

2012-11-22 23:42:16

program fighte;
Const
// fill out
NPC=10468317;
loot=8345019;
tolorence=15;
time=3; // in seconds
rwait=1000;
tleft= 93;
tright = 139;
bleft=630;
bright=447;
// player detection
playerx1=259;
playery1=160;
playerx2=275;
playery2=189;
// hitbar
hpx1=242;
hpy1=159;
hpx2=296;
hpy2=165;
hpcol=50036;





procedure clicknpc;
var
X,Y: Integer;
begin
if FindColorTolerance(X,Y,NPC,tleft,tright,bleft,bright,tolerence)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_Left)
waitloot; //Make sure this is declared before
Wait((time*1000) + Random(rwait));
if FindColorTolerance(X,Y,hpcol,hpx1,hpy1,hpx2,hpy2,tolerence)
then waitloot //Don't put a semi colon after a then, that also has an else in it
else
loot;
if FindColorTolerance(X,Y,loot,tleft,tright,bleft,bright,tolerence)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_right)

FindBitmap(14, 12, 'meJyTUdd2mPAfGcmoa+NCEAUMYI' +
'BfMVwlGptylXAEcQamFB53oonjsR2NTVOVxPgIiBhQAXLIYBXEjwD' +
'OzpG+');
// ?? no idea what to do from here.
else
Writeln('Failed to Find Npc')
wait(500);
procedure clicknpc;
end;
end;
begin
repeat
clicknpc;
until (False);
end.

Man, you need a lesson on the basics of pascal first. Take a look at the TuT in my signature first, get a basic understanding. You have many concept flaws. Finally, Please…Dear god…Please…Use the tab button more efficiently :').

For the bitmaps, I would try FindObjectDeformed. Take a look at this.

Also, take a look at Coh3ns guide after mine, that should clear your doubts.
~Rez

rj

2012-11-22 23:46:02

From: Rezozo
I edited it in the quote.
Man, you need a lesson on the basics of pascal first. Take a look at the TuT in my signature first, get a basic understanding. You have many concept flaws.

Also, take a look at Coh3ns guide after mine, that should clear your doubts.
~Rez


[Error] (39:8): Unknown identifier 'waitloot' at line 38
Compiling failed.

No idea were to declare it.

Rezozo

2012-11-22 23:51:06

Did you make a procedure that waits for the loot? There is no such function/procedure pre defined by SRL, to my knowledge.
~Rez

rj

2012-11-22 23:53:45

The procedure im using checks to see if the hp bar is above the player. as soon as it goes away it is suposed to then right click the search for the bitmap

Rezozo

2012-11-22 23:57:05

Is that called waitloot? Did you even include it in the program? As far as I see, that isn't there.
Also, another thing for your bitmaps: Here.
~Rez

rj

2012-11-23 00:08:11

sec im following tut, gonna rewrite and see what i get

rj

2012-11-23 00:17:36

Ok so i tried to do a dry run.. and it did not work(i got no errors)
Program TestBitMap;

Var
X, Y, charm: Integer; {All the script variables were declared here}

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

End;
Procedure FreeThings;
Begin
FreeBitMap(charm);
End;
Procedure pickup;
Begin
FindColorTolerance(X,Y,1479346,183,125,334,231,15)
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_right)
If FindBitMapToleranceIn(charm, X, Y,248, 197, 270, 214, 65) Then
Begin
WriteLn('Debug: We Found charm');
movemouse(X, Y);
ClickMouse(X, Y, Mouse_left)
End Else
WriteLn('Debug: We Could Not Find The charm');
End;
Begin

CallThings;
//AddOnTerminate('FreeThings');


Repeat
Until(False)
FreeThings;
Terminatescript();
End.
going to be be on again tomorow

Lord

2012-11-23 00:36:55

It's pretty hard to pickup things with simba. The colour detection is not the best with items on the ground

Rezozo

2012-11-23 00:53:34

From: Lord
It's pretty hard to pickup things with simba. The colour detection is not the best with items on the ground


You just have to know what to look for and how to look for it. ;)
Damn, I need to sleep. GN.
~Rez