SRL Archive - SRL Archives

Procedure';s and functions that ive been working on


solemn wishes

2006-03-05 13:33:40

hey,

well here is a few procedures and functions ive made, please post what you think and how they can be inproved ect ect….most are based around thiefving since srl doesnt have that yet.



function findtolinc(xcord1,ycord1,xcord2,ycord2,color:integer):boolean;
var x,y,tol:integer;
begin
result:=false;
tol:=5;
begin
if(FindColorSpiralTolerance(x,y,color,xcord1,ycord1,xcord2,ycord2,tol))Then
result:=true;
end;
begin
if(result=false)then
begin
tol:=10;
if(FindColorSpiralTolerance(x,y,color,xcord1,ycord1,xcord2,ycord2,tol))Then
result:=true;
end;
end;
end;



Procedure GetFoodColor;
var Row,Col,Ix,Iy,InvLoc:integer;
begin
InvLoc:=1; Col:=1; Row:=1;
if(Not(GetColor(633,176)=2829182))then
Mouse(650,185,5,5,true);
begin
repeat
Ix:=(Col-1)*42+574; Iy:=(Row-1)*36+218;
movemousesmooth(Ix+random(17),Iy+random(17));
wait(100+random(50));
Row:=Row+1;
if(Row>7)then
begin
Col:=Col+1;
Row:=1;
end;
until(IsTextAt2(9,9,'Eat',100)or(InvLoc=28))
begin
getmousepos(x,y);
foodtoeat:=getcolor(x,y);
writeln('Food Color is '+inttostr(foodtoeat));
end;
end;
end;



procedure Umouse(xcord,ycord:integer); // to be completed soon
var a,b,c,d,e,x1r,y1r,value:integer;
begin
x1r:=0;
y1r:=0;
d:= random(2) + 1;
value:=1+random(15)-random(10);
begin
if(d=1)then Pmd:=('+')
else
Pmd:=('-')
begin
x1r:=xcord + (value) if(Pmd='+')then x1r:=x1r+1 else;
if(Pmd='-')then x1r:=x1r -1
y1r:=ycord + (value) if(pmd='+')then y1r:=y1r+1 else;
if(Pmd='-')then y1r:=y1r -1
writeln('X pos was:='+inttostr(xcord)+' Know is:='+inttostr(x1r))
writeln('Y pos was:='+inttostr(ycord)+' Know is:='+inttostr(y1r))
begin
//x1r:=x1r/6 b:=x1r; to be completed soon
//y1r:=y1r/6 c:=y1r; to be completed soon
MoveMouseSmoothEx(x1r,y1r, 2, 4, 50, 20, 10)
wait(50+random(50)+random(50)+random(50))
end;
end;
end;
end;


procedure thiefperson;
begin
if(Thiefing='person')then
begin
if(findtolinc(5,5,514,337,victimcolor))then
begin
MMouse(x,y,1,3)
If(IsTextAt2(9,9,'Attack',100))or
(IsTextAt2(9,9,'Pickpocket',100))then
mouse(x,y,1,2,false)
if(FindbitmapspiralTolerance(pickpock,x,y,5,5,757,491,50))or
(FindbitmapspiralTolerance(pickpocket2,x,y,5,5,757,491,50))then
mouse(x,y,1,2,true)
stolen:=stolen+1;
flag;
end;
end;
end;




procedure drop;
var Row,Col,Ix,Iy,InvLoc:integer;
begin
InvLoc:=1; Col:=1; Row:=1;
Mouse(651,186,5,6,true)
repeat
Ix:=(Col-1)*42+574;
Iy:=(Row-1)*36+218;
movemousesmooth(Ix+random(17),Iy+random(17));
wait(random(10)+150+random(30));
If(IsTextAt2(9,9,'Use',100))then
begin
GetMousePos(x,y);
ClickMouse(x,y,false);
wait(random(150)+120+random(25));
if(FindBitmapToleranceIn(Drop,x,y,533,201,756,471,150))or
(FindBitmapToleranceIn(Droptext,x,y,533,201,756,471,150))then
mouse(x,y,5,5,true)
end;
InvLoc:=InvLoc+1;
Row:=Row+1;
if(Row>7)then
begin
Col:=Col+1;
Row:=1;
end;
until(InvLoc>28)
end;



procedure findboxNEW;
begin
if(Not(GetColor(633,176)=2829182))then
Mouse(650,185,5,5,true);
begin
if FindBitMapspiralTolerance(box,x,y,554,205,743,464,50) then
begin
typesend('dam i gtg guys :( bye'+chr(13))
writeln('/////////////////////////////////////////')
writeln('// STRANGE BOX FOUND IN YOUR INVENTORY \\')
writeln('// SCRIPT WILL KNOW TERMINATE \\')
writeln('/////////////////////////////////////////')
Mouse(647,484,3,5,true);
wait(100+random(500))
Mouse(644,369,5,5,True)
terminatescript;
end;
end;
end;



procedure thiefbitmaps;
begin
Drop := BitmapFromString(29, 11, 'z78DA7373C30E4C1D4D4D4D8' +
'C061B89EC42033018CC6EC6742DA6F8D0722DB2F8D072AD1BD1E9' +
'DC8DC41C418C7ACA5D6B800470E9C59F2388574F896B31DD492D3' +
'3892901283179D4B5F85D4B5E9A2435D7E0379318F5067801A64B' +
'F0CBE252497C3AC7A51E005840B4F8');

Droptext:= BitmapFromString(29, 11, 'z78DA73737373333070C320' +
'4D1D4D4D4D8C061B89EC420818CC6EC6742DA6F8D0722DB2F8D07' +
'2AD1BD1E9DC8DC41C418C7ACA5D8B0C70E9C59F2388574F896B31' +
'DD492D33892901283179D4B5F85D4B5E9A2435D7E0379318F5067' +
'801A64BF0CBE252497C3AC7A51E00D98EA294');

pickpock := BitmapFromString(71, 14, 'z78DAED98D10D40210803' +
'57720AF71FE94D6082946279299F86E8E90531AEE59814FB103D2' +
'B4E3C251D0636954DE5663E652AB0D914620A67B6A92A530855A4' +
'EBDDAE78DB4919F93C66466655ADE5D83AC71598F1BA66EC9A7D3' +
'34F64D634F5D79A42F6A866EAAD914E66DEDB2F979FEBCE91D350' +
'7B51C4C7739538F7FFC4BF4936E5B0A9AAF800D25BD935');

pickpocket2 := BitmapFromString(71, 15, 'z78DAED98D10D80200' +
'C4457620AF71F4906C0A45CB97AD5BB0F3F48230F5E2AC4319C4E' +
'B96656CF9A193BEE920E039BCAA6B0373F552AB0D954C6549ED9A' +
'64E99CA50454EBDDD19774F52463D8F995179AAD730B6CA7105E6' +
'7C5F3356CDFE327764D634F5D59ECAAC51CDD4BB462A9979773FA' +
'C1E3B9D23BBA176A3888F639DD8F7FF8963538E4DD9D4DF7203AD' +
'8A00EC');


box := BitmapFromString(18, 16, 'z78DAED944B0A80300C05AF649' +
'2D7A8CBA0BDFF952C8D8B8A16BFE0A60D0C21D0CC5B454C902A93' +
'95D30B8A88F815299291F9FE4030D89E5264287969FF404ABAF95' +
'5B15C612DC941B6179667ECA1A38EDE634640F0498D6BDA413855' +
'49952E5566CD72D775928478E2A9B99AABB9FE75EDE7DFBAEEDEC' +
'6672EBF63DE2F0DEA7540');
end;

Sdcit

2006-03-05 13:36:50

ummm we have alot of them already in SRL? nice. standards please :)

solemn wishes

2006-03-05 13:39:53

o ok :(, well im adding a few more anyway just searching for whre i saved my other functions

Wizzup?

2006-03-05 15:57:12

Looks good, but try to use standards. :)

Mutant Squirrle

2006-03-05 16:09:30

lol when u quote things it auto makes it like that its gay -_- he may or may not have used standards

Cheesehunk

2006-03-05 16:13:17

From: mutant squirrle
lol when u quote things it auto makes it like that its gay -_- he may or may not have used standards

Nope, he used Code tag's, they come out how you wrote them…
an example of this is the thief Bitmaps he has.

Mutant Squirrle

2006-03-05 17:27:13

ah your right it is code haha dammit i couldnt find the code one (feels semi retarded)

Sdcit

2006-03-05 17:28:26

its the numbers thing you can also do


withought the spaces

WT-Fakawi

2006-03-05 18:02:45

I think you are a very creative programmer, solemn wishes. I have noticed your work ever since your first scripts, if I remember it well, you managed to create your own talking random and pickhead procedures…

But I must admit you are being over creative.

- Take ThiefPerson for instance. What you have basically written is FindObj! Good job though :)

- Also, you might try using IsUpText aot IsTextAt2. This finds any piece of text in the upperleft corner. We have been working on that for quite a while and had at one time 4 version of it inside SRL. Besides, IsTextAt2 is more or less obsolete…

- Procedure GetFoodColor will work even better if you'd convert it to Function GetFoodColor: Integer; which returns the wanted color.

- And the mouse moves much smoother if you replace mousemousesmooth with mmouse, serious. (You can try out two algorhythms , BenLand100's or Mutant/RsN's. Toggle the const useBenMouse inside MouseFlag.scar.)

- And, for me, reading non popped/stacked code is just to difficult.You really should use identing, otherwiseitlookslikethisandIamhavingahardtimereadingthisunderstandwhatimsaying?

I admire your pruductivity solm, you are doing a great job, but if you want to increase your Programming Knowledge fast, look into other peoples work and absorb, think, copy and learn from it.

Keep 'm coming!

solemn wishes

2006-03-06 08:29:35

ok thx for comments, ill admit i havnt been really keeping up-to-date with things lately but i hope to get back into it all from know.