Results 1 to 22 of 22

Thread: Princes Procedures and Functions...

  1. #1
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Princes Procedures and Functions...

    Heres Some Procedures...
    Procedures So far 2
    Functions So far 0



    RandomTab! (and HoverMouse)


    AntiBan

    Code:
    {**************************************************************************
    Procedure:RandomTab
    By:The Prince of Randomness
    Description:AntiBan Uses tabs Randomly for AntiBan
    ***************************************************************************}
    Var Tab:integer;
    
    {*******************************************************************************
    procedure HoverSkill;
    By: Dankness
    Description: Hovers mouse over selected skill to "check exp"
    *******************************************************************************}
    
    procedure hoverskill(skill:string);
    var row,col:integer;
    begin
     case lowercase(skill) of
      'attack'     :begin row:=1; col:=1; end;
      'strength'   :begin row:=2; col:=1; end;
      'defence'    :begin row:=3; col:=1; end;
      'range'      :begin row:=4; col:=1; end;
      'prayer'     :begin row:=5; col:=1; end;
      'magic'      :begin row:=6; col:=1; end;
      'runecraft'  :begin row:=7; col:=1; end;
      'hitpoints'  :begin row:=1; col:=2; end;
      'agility'    :begin row:=2; col:=2; end;
      'herblore'   :begin row:=3; col:=2; end;
      'thieving'   :begin row:=4; col:=2; end;
      'crafting'   :begin row:=5; col:=2; end;
      'fletching'  :begin row:=6; col:=2; end;
      'slayer'     :begin row:=7; col:=2; end;
      'smithing'   :begin row:=1; col:=3; end;
      'mining'     :begin row:=2; col:=3; end;
      'fishing'    :begin row:=3; col:=3; end;
      'cooking'    :begin row:=4; col:=3; end;
      'firemaking' :begin row:=5; col:=3; end;
      'woodcutting':begin row:=6; col:=3; end;
      'farming'    :begin row:=7; col:=3; end;
      'random'     :begin row:=random(6)+1; col:=random(2)+1; end;
     end;
     gametab(2);
     if useBenMouse then
      mmouse(532+(64*col),191+(31*row),10,10)
     else
      mmouse2(532+(64*col),191+(31*row),10,10);
     wait(5000+random(5000));
    end;
    
    {**************************************************************************
    RandomDeclare Procedures
    By:The Prince of Randomness
    description: Declares all Randoms
    ****************************************************************************}
    
    Procedure DeclareRandomTabs;
    var i:integer;
    Begin
    I:=Random(8+1);
    Begin
    If(i=1)Then
    Begin
      GameTab(1);
        Tab:=1;
     If(i=2)Then
    Begin
      GameTab(2);
        Tab:=2;
    If(i=3)Then
    Begin
      GameTab(3);
        Tab:=3;
    If(i=4)Then
    Begin
      GameTab(4);
        Tab:=4;
    If(i=5)Then
    Begin
      GameTab(5);
        Tab:=5;
    If(i=6)Then
    Begin
      GameTab(6);
        Tab:=6;
    If(i=7)Then
    Begin
      GameTab(7);
        Tab:=7;
    If(i=8)Then
    Begin
      GameTab(8);
        Tab:=8;
             End;
            End;
           End;
          End;
         End;
        End;
       End;
      End;
     End;
    End;
    
    
    
    Procedure DeclareRandomFight;
    Var i:integer;
    Begin
    if(Tab=1)Then
    Begin
    i:=Random(4+1);
    Begin
    If(i=1)Then
    Begin
      SetFightMode(1);
    If(i=2)Then
    Begin
      SetFightMode(2);
    If(i=3)Then
    Begin
      SetFightMode(3);
    If(i=4)Then
    Begin
      SetFightMode(4);
           End;
          End;
         End;
        End;
      End;
     End;
    End;
    
    
    Procedure DeclareRandomSkill;
    Begin
    hoverskill('random');
    End;
    
    {**************************************************************************
    Procedure The Hover Over Wielded items
    By:The Prince of Randomness
    ******************************************************************************}
    Procedure HoverMouse(X,Y,WaitTime,RangeOfWidth:integer);
    Var
    TimeVar,Tol:integer;
    Begin
    Tol:= 10*RangeOfWidth;
    MarkTime(TimeVar);
    Repeat
        MMouse(X,Y,Tol,Tol);
    Until(TimeFromMark(TimeVar)>WaitTime);
    End;
    
    Procedure HoverOverWeapon;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(590,302)=2304814))Then
      Begin
      HoverMouse(590,302,2000,10);
      End;
    end;
    
    Procedure HoverOverHat;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(225,15)=2304814))Then
      Begin
      HoverMouse(640,215,2000,10);
     End;
    End;
    
    Procedure HoverOverCape;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(607,267)=4540745))Then
      Begin
      HoverMouse(607,267,2000,10);
     End;
    End;
    
    Procedure HoverOverNecklace;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(649, 271)=4803917))Then
      Begin
      HoverMouse(649,271,2000,10);
    End;
    End;
    
    Procedure HoverOverArrows;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(690,265)=2304814))Then
      Begin
      HoverMouse(680,265, 2000,3);
     End;
    End;
    
    Procedure HoverOverBody;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(649, 308)=4803917))Then
      Begin
      HoverMouse(649,308,2000,3);
     End;
    End;
    
    Procedure HoverOverShield;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(704, 304)=2304814))Then
      Begin
      HoverMouse(704,304,2000,3);
     End;
    End;
    
    Procedure HoverOverLegs;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(648, 339)=2304814))Then
      Begin
      HoverMouse(648, 339,2000,3);
     End;
    End;
    
    Procedure HoverOverGloves;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(225,15)=2304814))Then
      Begin
      HoverMouse(580,375,2000,3);
     End;
    End;
    
    Procedure HoverOverBoots;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(646, 384)=5067346))Then
      Begin
      HoverMouse(646, 384,2000,3);
     End;
    End;
    
    Procedure HoverOverRing;
    Begin
      GameTab(5);
      wait(random(300) + 300);
      If(not(GetColor(703, 383)=2304814))Then
      Begin
      HoverMouse(703,383,2000,3);
     End;
    End;
    
    Procedure DeclareRandomWear;
    var i:integer;
    Begin
    i:=Random(11+1);
    Begin
    if(i=1)Then
    Begin
    HoverOverRing;
    if(i=2)Then
    Begin
      HoverOverBoots;
    if(i=3)Then
    Begin
      HoverOverGloves;
    if(i=4)Then
    begin
      HoverOverLegs;
    if(i=5)Then
    Begin
      HoverOverShield;
    if(i=6)Then
    Begin
      HoverOverBody;
    if(i=7)Then
    Begin
      HoverOverArrows;
    if(i=8)Then
    Begin
      HoverOverNecklace;
    if(i=9)Then
    Begin
      HoverOverCape;
    if(i=10)Then
    begin
      HoverOverHat;
    if(i=11)Then
    Begin
      HoverOverWeapon;
              End;
             End;
            End;
           End;
          End;
         End;
        End;
       End;
      End;
     End;
    End;
    End;
    End;
    
    {****************************************************************************
    RandomTab
    By:The Prince of Randomness
    Description:Uses Tabs Randomly, for Less chance of ban.
    *****************************************************************************}
    
    Procedure RandomTab;
    Begin
    Writeln('You are Now Randomly using tabs');
      DeclareRandomTabs;
    If(Tab=1)Then Begin
      DeclareRandomFight;
    If(Tab=2)Then Begin
      DeclareRandomSkill
    If(Tab=3)Then Begin
      Writeln('No Quest Random has been made yet');
    If(Tab=4)Then Begin
      Writeln('No Item Random has been made yet');
    If(Tab=5)Then Begin
      DeclareRandomWear;
    If(Tab=6)Then Begin
      Writeln('no Random Prayer Searching has Been Made yet');
    If(Tab=7)Then Begin
      WriteLn('No Random Mage has been made yet expect in next release');
    If(Tab=8)Then Begin
      Writeln('This tab searcher hasnt been made yet');
             End;
            End;
           End;
          End;
         End;
        End;
       End;
      End;
    End;

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

    Default

    hover mouse is already made, the newer version of SRL isnt realeased yet
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

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

    Default

    And for range of width, just do:

    Code:
    Tol:= RangeOfWidth*10;

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

    Default

    he means just have them put a 1 digit number like 1 and it multiplies it by ten to make tol:=10
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  5. #5
    Join Date
    Feb 2006
    Location
    Sunshine Coast, Qld. Australia
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Prince of Randomness
    Heres Some Procedures...
    Procedures So far 1
    Functions So far 0


    Hovermouse...


    Pretty Nooby but UseFul..

    EDIT: Kinda Deads nxt Version of SRL will include hovernouse but not mine =P..
    Kane i dont get you..?
    Good job noticing this was missing from SRL. Great job scripting it too. other version is alread in so... nm, but hey it still means you rock! Keep the suggestions coming, it's community effort like this that makes SRL so great!!!!

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

    Default

    *Sighs*

    Code:
    Case RangeOfWidth of
    1 : Tol:=10;
    2 : Tol:=20;
    3 : Tol:=30;
    4 : Tol:=40;
    5 : Tol:=50;
    6 : Tol:=60;
    7 : Tol:=70
    8 : Tol:=80;
    9 : Tol:=90;
    10 : Tol:=100;
    end;
    Can just be:
    Code:
    Tol:= Rangeofwidth*10;
    Since every 1 go's up by 10's.. Get it?..

  7. #7
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes i get it but..
    Do i put in where The Case of? is.

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

    Default

    well you can do

    tol:=tol*10

    case tol of...


    or

    case tol*10 of


    iguess
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

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

    Default

    Here you go:

    Code:
    Procedure HoverMouse(X,Y,WaitTime,RangeOfWidth:integer);
    Var
    a,b,TimeVar,Tol:integer;
    Begin
    Tol:= 10*RangeOfWidth;
    Repeat
      MarkTime(TimeVar);
      MMouse(X,Y,20,0);
      MMouse(X,Y,0,20)
      GetMousePos(a,b);
      MMouse(x,Y,Tol,Tol);
      GetMousePos(a,b);
      MMouse(a,b,Tol,Tol);
      MMouse(x,Y,Tol,Tol);
      MMouse(x,Y,Tol,Tol);
      MMouse(a,Y,Tol,Tol);
      MMouse(x,Y,Tol,Tol);
      MMouse(x,Y,Tol,Tol);
      MMouse(x,Y,Tol,Tol);
    Until(TimeFromMark(TimeVar)>WaitTime);
    End;

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

    Default

    Code:
     
    procedure HoverMouse(X, Y, WaitTime, RangeOfWidth:Integer);
    var
    a, b, TimeVar, Tol:Integer;
    begin
    Tol:= 10*RangeOfWidth;
    repeat
    MarkTime(TimeVar);
    MMouse(X, Y, 20, 0);
    MMouse(X, Y, 0, 20)
    GetMousePos(a, b);
    MMouse(x, Y, Tol, Tol);
    GetMousePos(a, b);
    MMouse(a, b, Tol, Tol);
    MMouse(x, Y, Tol, Tol);
    MMouse(x, Y, Tol, Tol);
    MMouse(a, Y, Tol, Tol);
    MMouse(x, Y, Tol, Tol);
    MMouse(x, Y, Tol, Tol);
    MMouse(x, Y, Tol, Tol);
    until(TimeFromMark(TimeVar)>WaitTime);
    end;
    [/CODE]
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  11. #11
    Join Date
    Feb 2006
    Location
    Sunshine Coast, Qld. Australia
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Since we all are flogging this one to death, I thought I would do my little bit of flogging...

    Code:
    Procedure HoverMouse(X,Y,WaitTime,RangeOfWidth:integer);
    Var
      TimeVar,Tol:integer;
      
    Begin
      Tol:= 10*RangeOfWidth;
      TimeVar := GetSystemTime + WaitTime; //Sorry Fakawi I hate your MarkTime...
    
      While GetSystemTime < TimeVar do
      begin
        MMouse(X, Y, Tol, Tol); //why say in 10 lines what you can say in one
        wait(5); //wait eliminate lag in the game
      end;
    end;

  12. #12
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    =P im still Learning. we All are Constantly learning..

  13. #13
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow you decreased the legth of the code by about 70lines
    <SmarterC> mixster: The only reason so many people are homosexuals

  14. #14
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Grrr =P, Nvm.. My next Procedure Will be cool =P..
    Im working on it now

  15. #15
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Updated!--- Random Tab! =P Beta stage

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

    Default

    pretty good, i recommend case instead of all those procedures?
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  17. #17
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmmm Where? the HoverWield?

  18. #18
    Join Date
    Feb 2006
    Location
    Myrtle Beach, SC USA!
    Posts
    841
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by The Prince of Randomness
    Hmmm Where? the HoverWield?
    Anytime you use If and the same varable more then twice is a good time to use case. Notice how i used case in my procedure instead of 22 if statements?

  19. #19
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok when i get home from school.. See yah..

  20. #20
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Hmm, I haven't looked here in while, did you just update them?
    I like some of the new Procedures, i never knew you could script well?

    Good job Prince!!
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  21. #21
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Random cheesy hunk.

    I decided to put my knowledge to use =P... ill update it soon or another day.

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

    Default

    Code:
    Case random(11)+1 of
     1: ..
     2: ..
    end;
    Etc.

    Instead of:
    Code:
    if(i=1)then
    begin
      dosomething
    if(i=2)then
    begin
     dosomething
    Also, lots of ends look bad

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. Help on functions - procedures.
    By R0b0t1 in forum OSR Help
    Replies: 9
    Last Post: 03-23-2007, 07:08 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
  •