Results 1 to 10 of 10

Thread: new ranging procedures and functions - please dont take for granted :)

  1. #1
    Join Date
    Feb 2006
    Location
    With mooncow on the moon
    Posts
    292
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default new ranging procedures and functions - please dont take for granted :)

    hey,

    well i saw that srl didnt have any ranging functions so i started to make these myself,ive kinda been working behind the scenes lately and not been very adtive but i hope to change that soon.


    i spent quite a while making these so please post comments



    Code:
    function monstertolerance(xcord1,ycord1,xcord2,ycord2:integer):boolean;
    var c,tolmonster,tol:integer;
     begin
       tol:=0;
      c:=0;
    if(FindColorSpiralTolerance(x,y,monster,xcord1,ycord1,xcord2,ycord2,tol))Then
      begin
        Mmouse(x,y,5,4)
          writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
         writeln('   Monster visable on screen, no tolerance needed')
       writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
     found:=true;
    end;
       if(found=false)then
          begin
            writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
           writeln('        No monster is visable on the screen')
          writeln('          Creating a monster tolerance')
        writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
      monsterfound:=false;
     tolmonster:=monster;
    repeat
     wait(500+random(500))
      tol:=tol+1;
        c:=c+1;
       writeln('monster color :'+inttostr(tolmonster))
      if(FindColorSpiralTolerance(x,y,tolmonster,xcord1,ycord1,xcord2,ycord2,tol))then
    begin
      monsterfound:=true;
        Mmouse(x,y,5,4)
      end;
        until(monsterfound=true)or(c=30)
      if(c=30)then
        writeln('')
          writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
             writeln('')
               writeln('Increased tolerance to 30, monster is still not visable')
             writeln('   Unable to find the monster, color may be wrong')
          writeln('')
       writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
      result:=false;
     end;
    end;

    Code:
    procedure selectbattletype;
    begin
    gametab(1)
    case style of
        'Accurate','accurate'   :mouse(590,287,5,5,true)
        'Rapid','rapid'         :mouse(601,334,4,5,true)
        'Longrange','longrange' :mouse(596,382,5,6,true)
     end;
    end;

    Code:
    procedure getarrowcolorA;
    var arrowsfound:boolean;
    begin;
     gametab(4)
       if(findcolorspiral(x,y,537172,559,208,740,457))then
           begin
            Mmouse(x,y,1,3)
          if(IsTextAt2(9,9,'Weild',100))then
        getmousepos(x,y)
      arrowcolorA:=getcolor(x,y)
        writeln('arrow color is: '+inttostr(arrowcolorA))
          mouse(x,y,1,1,true)
        arrowsfound:=true;
       end
     else
        if(findcolorspiral(x,y,4902398,672,171,697,204))then
          begin
            mouse(x,y,2,2,true)
          Mmouse(690,264,5,5)
        wait(500+random(800))
      if(IsTextAt2(9,9,'Remove',100))then
    begin
     getmousepos(x,y)
       arrowcolorA:=getcolor(x,y)
      writeln('arrow color is: '+inttostr(arrowcolorA))
     arrowsfound:=true;
    end
     else
      if(arrowsfound=false)then
        begin
          writeln('')
            writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
               writeln('')
             writeln('    No arrows where found in you inventory or equipted')
           writeln('              Unable to proceed logging out')
         writeln('')
      writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
     terminatescript;
    end;
     end;
      end;

    Code:
    procedure pickuparrows;
    var a,b:integer;
    begin
     a :=random(2);
      if(a=1)then
        begin
         repeat
        b:=b+1;
       wait(500+random(300))
     if(FindObj('Take',923247,5))then
    begin
     mouse(x,y,3,2,true)
      flag;
       end;
         until(not(FindObj('Take',923247,5))or(b=10))
          if(findcolorspiral(x,y,arrowcolorA,552,175,744,467))then
           Mmouse(x,y,5,3)
          if(IsTextAt2(9,9,'Wield',100))then
         begin
       mouse(x,y,1,1,true)
    end;
      end;
        end;
    Code:
    Procedure GetFoodColor;
    var Row,Col,Ix,Iy,InvLoc:integer;
    begin
     if(eatfood='yes')then
       begin
         InvLoc:=0; Col:=1; Row:=1;
           if(Not(GetColor(633,176)=2829182))then
             Mouse(650,185,2,2,true);
            begin
          repeat
        Ix:=(Col-1)*42+574; Iy:=(Row-1)*36+218;
       Mmouse(ix,iy,5,5)
       wait(100+random(50));
        InvLoc:=InvLoc+1;
           Row:=Row+1;
             if(Row>7)then
               begin
             Col:=Col+1;
           Row:=1;
         end;
       until(IsTextAt2(9,9,'Eat',100)or(InvLoc=28))
     begin
    if(IsTextAt2(9,9,'Eat',100))then
      getmousepos(x,y);
        foodcolor:=getcolor(x,y);
          writeln('Food Color is :'+inttostr(foodcolor));
        end;
      end;
     end;
    end;

    Code:
    procedure EatFoodIfNeeded;
    var foodleft:boolean;
    begin
     if(eatfood='yes')then
       begin
        if(gethp<eathp)then
         gametab(4)
       if(FindColorSpiraltolerance(x,y,foodcolor,560,210,730,460,5))then
         begin
        Mmouse(x,y,1,3)
         wait(250+random(250))
          foodleft:=true;
          begin
          mouse(x,y,1,3,true)
        foodeaten:=foodeaten+1
       begin
      if(foodleft=false) then
    begin
     writeln('')
       writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
         writeln('')
          writeln('          No food was found in your inventory')
            writeln('             Unable to proceed logging out')
           writeln('      This has gotta be better than dying hasnt it :D')
         writeln('')
       writeln('//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\')
         writeln('')
           logout;
          terminatescript;
         end;
       end;
     end;
    end;
     end;
      end;


    Code:
    procedure Attack;
    var gts,a,c,ax,ay,b:integer;
    begin
     b:=0;
      solemnrandoms;
        monstertolerance(4,5,515,337)
         begin
       If(IsTextAt2(9,9,'Attack',100))then
         begin
          mouse(x,y,1,3,true)
           flag;
         end;
       repeat
     a:=a+1;
      wait(750+random(750))
        until(FindColorSpiraltolerance(ax,ay,8246,240,125,270,180,5))or(a=3)
         begin
         c:= random(2)
            repeat
           gts:=gts+3;
      Writeln('Fighting current monster for around '+inttostr(gts)+' second(s)')
     wait(1000+random(750));
    if(c>1)then
      begin
        EatFoodIfNeeded;
          solemnrandoms;
           end;
         until(not(FindColorSpiral(ax,ay,65280,240,125,270,180)))
      pickup;
     Killed:=Killed+1;
    EatFoodIfNeeded;
      solemnrandoms;
        end;
      end;
    end;

  2. #2
    Join Date
    Mar 2006
    Location
    Wijk bij Duurstede
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mhh some nicely made procedures. Is it ok if I use some for my auto fighter I'm making?
    <3 I have something to hide : But it's a secret so you won't know until I reveal it so wait.

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

    Default

    nice..nice indeed, your set range attack style thingy is already a function in gametab.scar

    Have a higher tol than 30
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  4. #4
    Join Date
    Feb 2006
    Posts
    920
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think we desided not to include these kind of procedures in SRL, I will therefor not add them myself and I would be disappointed if any other with access to the SRL include would do so.

    Othervise they're okay procedures, I just had some trouble reading them. The procedures didn't have the right soul

  5. #5
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    Solemn,

    I like it. You know, I have always admired your enormeous creativity. I remember @ Kait you tried to solve Randoms yourself even though all the includes where already there. And although not all your code is a display of order and logic , I like your persistency. I will look into your procedures and tell I will tell you where to improve..... is that ok with you?


    P.S.
    Explain to me -if you want- why you make "Turtorials" as opposed to "Tutorials"?
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  6. #6
    Join Date
    Feb 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    er... fyi, i have added these procedures to ranging.scar:

    Code:
    function arrowamount:integer;
    returns number of arrows wielded
    
    function getarrowcolor:boolean;
    returns arrow head/tail color
    
    function findinvarrows(var arrowx,arrowy:integer):boolean;
    returns true if arrows of head/tail color are in inv
    
    function invarrows:integer;
    returns how many arrows in inv
    but yeah, last i heard we were going to get away from fightnpc functions

  7. #7
    Join Date
    Feb 2006
    Location
    With mooncow on the moon
    Posts
    292
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by WT-Fakawi
    Solemn,

    I like it. You know, I have always admired your enormeous creativity. I remember @ Kait you tried to solve Randoms yourself even though all the includes where already there. And although not all your code is a display of order and logic , I like your persistency. I will look into your procedures and tell I will tell you where to improve..... is that ok with you?


    P.S.
    Explain to me -if you want- why you make "Turtorials" as opposed to "Tutorials"?


    ya i would be glad if you told me where they can be inproved, and i really suck at spelling lol

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    could you attach all those functions in one .scar file, please


    [offtopic]
    Masquerader has really outdone himself this time. He has made a "amount" reader. It even counts your millions of coins. This is extremely useful for auto buy/sellers/tradebots/ranging/ virtually anything with "amounts", farming probably but I dont p2p

    I would love to have a trade bot selling powerammys
    [/off topic]
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  9. #9
    Join Date
    Feb 2006
    Location
    With mooncow on the moon
    Posts
    292
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    here you go

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

    Default

    Quote Originally Posted by WT-Fakawi
    could you attach all those functions in one .scar file, please


    [offtopic]
    Masquerader has really outdone himself this time. He has made a "amount" reader. It even counts your millions of coins. This is extremely useful for auto buy/sellers/tradebots/ranging/ virtually anything with "amounts", farming probably but I dont p2p

    I would love to have a trade bot selling powerammys
    [/off topic]

    Ahh yes syupids merchanter. I heard it is somewhat amazing. But with masquerader doing this amount stuff i think it will be much easier to make our own. Ill get onto it tonite. Lol and push my ess miner back. I always end up with half finishd scripts

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 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
  •