SRL Archive - SRL Archives

Skill procedures/functions


Neonknight77

2006-03-14 18:07:04

Here is some stuff you can look at.
FindBitmapUp basically looks for a bitmap and checks if the strings are in Coordinates 9,9. If Implemented, this should go in core

program New;
{.include SRL.scar}
Function FindBitmapUp(Fx,Fy,Bitmap1: Integer;UpText: String): Boolean;
begin
If(FindBitmap(Bitmap1,Fx,Fy))Then
MMouse(Fx+7,Fy+8,2,2);
Sleep(200+Random(250));
If(IsUpText(UpText))Then
Result:=True;
End;
This is for RuneCrafting. Uses FindBitmapUp to look if you have a talism in your inventory

program New;
{.include FindBitmapUp.scar}
Var
AirTally,MindTally,WaterTally,EarthTally,FireTally,BodyTally,Fx,Fy: Integer;
Procedure LoadTallyBitmaps;
Begin
AirTally := BitmapFromString(19, 17, 'z78DA33301805230A180E' +
'ACF54E2E4EC64EC6C3C94688F9C8B6E062D3C77798EEA1A7DFE9E' +
'33B7AFA8BFE2976148C6400009A117071');
MindTally := BitmapFromString(11, 11, 'z78DA3330C0030C9D9DC' +
'C9D0D2D0C68065C5C2CCC0D9D2830C010423A1999B9189A526002' +
'C900C946436A8506C44CFC7E415683A1D2902CF7532134A86A021' +
'50000F2048A5B');
WaterTally := BitmapFromString(11, 11, 'z78DA33301805440057' +
'43530B0B2A98408939949B306200007BC688F8');
EarthTally := BitmapFromString(11, 12, 'z78DA3330185CC0D4DC' +
'D8C9C01293A48F09B854126F0E7EDB4975097921300A280700419' +
'4979F');
FireTally := BitmapFromString(11, 12, 'z78DA333018CEC0C2C2D' +
'0C9C09512BDC826E0621363022E72F09B80CB9C619D700C005E20' +
'9A31');
BodyTally := BitmapFromString(13, 13, 'z78DA333020080C91494' +
'30B435727578341090C4D0D2D1CCD06831BF0BB84FEEE24C65583' +
'270C4701AD010095A0BF74');
End;
Function FindTally(Fx,Fy: Integer;Tally:String): Integer;
Begin
GameTab(4);
Case Tally of
'Air': FindBitmapUp(Fx,Fy,AirTally,'Air');
'Mind': FindBitmapUp(Fx,Fy,MindTally,'Mind');
'Water': FindBitmapUp(Fx,Fy,WaterTally,'Water');
'Earth': FindBitmapUp(Fx,Fy,EarthTally,'Earth');
'Fire': FindBitmapUp(Fx,Fy,FireTally,'Fire');
'Body': FindBitmapUp(Fx,Fy,BodyTally,'Body');
End;
End;
This is for Smelting. Opens the furnace if your standing North.

Program New;
{.include SRL.scar}
Procedure OpenFurnace3;
Var
What: Integer;
Begin;
BitmapFromString(38, 20, 'z78DAED96C10DC030080357E2' +
'79FB4FD6098A68C02D527D8F3C104831102B11C618F325DC9C95A' +
'A18CDD4A9ABDCE72CCE9A0976B474AA36E8FD8F46045BA19EC8EC' +
'042B1AEB6E9667227348043B80CC19366BAC7B32B2DDE6158D887' +
'D0C4157FBBBAAF0B1A7AF7EAA6FA4F1CD7F0C634CCE05FB0959FE' +
'');
MarkTime(Mark);
Repeat
If(Not (Loggedin))Then Break;
If(FindColorSpiralTolerance(x,y, 2514608,MSX1,MSY2,MSX2,MSY2, 20))Then
Begin;
MMouse(X,Y,2,2);
If(IsUpText('Smelt Furnace'))Then
Mouse(x+Random(15),y,2,2,True);
End;
Wait(1500+Random(1500));
Until (FindBitmapIn(What,X,Y,MCX1,MCY1,MCX2,MCY2)) or (TimeFromMark(Mark)>(60000)));
End;
Begin
OpenFurnace3;
End.

The Un-Named

2006-03-14 18:15:19

They all look good. Good work. :)

timmyboy

2006-03-14 19:11:39

We can use this in our scripts right? If so, ty for the RuneCrafting, saved me about 15min of work:D

Sdcit

2006-03-14 19:28:16

we should have something like findbitmap up in text.scar right?
good job :). Use PerfectNorth for a prefect north view

Renax

2006-03-14 19:34:18

we try not to use specific functions like the open furnace, try using masks for the tallies.

XxKanexX

2006-03-14 23:57:43


Function FindTally(Fx,Fy: Integer;Tally:String): Integer;
Begin
GameTab(4);
Case Tally of
'Air': FindBitmapUp(Fx,Fy,AirTally,'Air');
'Mind': FindBitmapUp(Fx,Fy,MindTally,'Mind');
'Water': FindBitmapUp(Fx,Fy,WaterTally,'Water');
'Earth': FindBitmapUp(Fx,Fy,EarthTally,'Earth');
'Fire': FindBitmapUp(Fx,Fy,FireTally,'Fire');
'Body': FindBitmapUp(Fx,Fy,BodyTally,'Body');
End;
End;
Why is this a function? It dosn't result in anything.

And can you please use the standards, it makes things so much more legible.

The Un-Named

2006-03-15 07:49:29

And readable. :P

XxKanexX

2006-03-15 15:36:10

From: The Un-Named
And readable. :P

legible = understandable = readable ;)