Results 1 to 8 of 8

Thread: Skill procedures/functions

  1. #1
    Neonknight77 Guest

    Default Skill procedures/functions

    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
    Code:
    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
    Code:
    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.
    Code:
    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.

  2. #2
    Join Date
    Feb 2006
    Posts
    1,022
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    They all look good. Good work.

  3. #3
    Join Date
    Mar 2006
    Location
    Igloo #201702,Canada
    Posts
    188
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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


    ^ My next tutorial will teach you how to make this ^

  4. #4
    Join Date
    Feb 2006
    Location
    California-Foster City
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    we should have something like findbitmap up in text.scar right?
    good job . Use PerfectNorth for a prefect north view
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  5. #5
    Join Date
    Feb 2006
    Posts
    381
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

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

  6. #6
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    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.

  7. #7
    Join Date
    Feb 2006
    Posts
    1,022
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And readable. :P

  8. #8
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Un-Named
    And readable. :P
    legible = understandable = readable

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 16
    Last Post: 07-31-2008, 05:40 PM
  2. Functions or Procedures One Shouldn't Use?
    By Azzon in forum OSR Help
    Replies: 2
    Last Post: 01-28-2007, 06:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •