Results 1 to 10 of 10

Thread: Procedure';s and functions that ive been working on

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

    Default Procedure';s and functions that ive been working on

    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.



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

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

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

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


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


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


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

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

    Default

    ummm we have alot of them already in SRL? nice. standards please
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

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

    Default

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

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Looks good, but try to use standards.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  5. #5
    Join Date
    Mar 2006
    Posts
    509
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

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

    Default

    Quote Originally Posted by 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.
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  7. #7
    Join Date
    Mar 2006
    Posts
    509
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

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

    Default

    its the numbers thing you can also do

    [code ]
    [/code ]
    withought the spaces
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

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

    Default

    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, otherwiseitlookslikethisandIamhavingahardtimereadi ngthisunderstandwhatimsaying?

    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!
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

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

    Default

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Chopping procedure not working
    By dallas574 in forum OSR Help
    Replies: 7
    Last Post: 08-20-2008, 11:11 PM
  2. Replies: 16
    Last Post: 02-06-2008, 05:12 PM
  3. procedure Mouse not working?
    By alartt in forum OSR Help
    Replies: 4
    Last Post: 09-30-2007, 01:07 PM
  4. Login functions not working
    By Metagen in forum OSR Help
    Replies: 4
    Last Post: 07-17-2007, 03:03 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
  •