Results 1 to 18 of 18

Thread: Looking for extending my script

  1. #1
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Looking for help extending my script

    i am asking for help adding onto this script, it already locates and kills mobs, but i would like to be able to further it by using a set of hotkeys in the game , F1,F2,F3. i would like to know how to add these into my script to be pressed at certain timed intervals.also is there any script i can put in place to say "if i dont find what i am looking for do this"? I have tried the SendKey commands with no results....any help will be greatly appreciated.ty.
    Code:
    var x,y,horn2,crab5,crabback,hornwing:Integer;
     procedure Loadhorn2;
    begin
    horn2 := BitmapFromString(2, 3, 'z78DA73733333347174C34B020' +
           '09D380871');
           end;
     procedure Loadcrab5;
    begin
    crab5 := BitmapFromString(5, 4, 'z78DAB37036713134B0A03B090' +
           '04AE61A91');
           end;
    procedure Loadcrabback;
    begin
    crabback := BitmapFromString(4, 3, 'z78DA3377327731B634A798' +
           '04005B2A1081');
           end;
    Procedure Findhorn2;
    begin
    if(FindBitmap(horn2,x,y))then
    begin
    clickmouse(x,y,true)
    wait(7000);
     end else
    end;
    Procedure Findcrab5;
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    clickmouse(x,y,true)
    wait(7000);
    end else
    end;
    Procedure Findcrabback;
    begin
    if(FindBitmap(crabback,x,y))then
    begin
    clickmouse(x,y,true)
    wait(7000);
    end else
    end;
    Procedure Findhornwing;
    begin
    if(FindBitmap(hornwing,x,y))then
    begin
    clickmouse(x,y,true)
    wait(7000);
    end else
    end;
    begin
    Loadhorn2;Loadcrab5;Loadcrabback;
    repeat Findhorn2;Findcrab5;Findcrabback;
    until(false)
    end.

  2. #2
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    try this >.< use srl/srl.scar include change all the clickmouse's to mouse(x,y,randx,randy,boolean) and then try it

  3. #3
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i tried ur suggestion, which i assume will help with the "didnt find what i was looking for" thing, but it says "duplicate identifier "x" in script...any help with that?

  4. #4
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Remove the variables x and y from the script.

  5. #5
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    {.include SRL/SRL.scar}
    var x,y,horn2,crab5,crabback,hornwing:Integer;
     procedure Loadhorn2;
    begin
    horn2 := BitmapFromString(2, 3, 'z78DA73733333347174C34B020' +
           '09D380871');
           end;
     procedure Loadcrab5;
    begin
    crab5 := BitmapFromString(5, 4, 'z78DAB37036713134B0A03B090' +
           '04AE61A91');
           end;
    procedure Loadcrabback;
    begin
    crabback := BitmapFromString(4, 3, 'z78DA3377327731B634A798' +
           '04005B2A1081');
           end;
    Procedure Findhorn2;
    begin
    if(FindBitmap(horn2,x,y))then
    begin
    mouse(x,y,randx,randy,boolean)
    wait(5000);
     end else
    end;
    Procedure Findcrab5;
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    mouse(x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;
    Procedure Findcrabback;
    begin
    if(FindBitmap(crabback,x,y))then
    begin
    mouse(x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;
    Procedure Findhornwing;
    begin
    if(FindBitmap(hornwing,x,y))then
    begin
    mouse(x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;
    begin
    Loadhorn2;Loadcrab5;Loadcrabback;
    repeat Findhorn2;Findcrab5;Findcrabback;
    until(false)
    end.
    that is what i chngd script to, when u say remove x,y var, i removed the ones in top var line, that didnt work, then i removed all x,y from script, that didnt work either, obviously it says missing var as error, which x,y should i remove?

  6. #6
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    PHP Code:
    {.include SRL/SRL.scar}
    var 
    horn2,crab5,crabback,hornwing:Integer;

     
    procedure Loadhorn2;
    begin
    horn2 
    := BitmapFromString(23'z78DA73733333347174C34B020' +
           
    '09D380871');
           
    end;

     
    procedure Loadcrab5;
    begin

    crab5 
    := BitmapFromString(54'z78DAB37036713134B0A03B090' +
           
    '04AE61A91');
           
    end;
     
     
    procedure Loadcrabback;
    begin
    crabback 
    := BitmapFromString(43'z78DA3377327731B634A798' +
           
    '04005B2A1081');
           
    end;

     
    Procedure Findhorn2;
    begin
    if(FindBitmap(horn2,x,y))then
    begin
    mouse
    (x,y,randx,randy,boolean)
    wait(5000);
     
    end else
    end;

     
    Procedure Findcrab5;
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    mouse
    (x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;

     
    Procedure Findcrabback;
    begin
    if(FindBitmap(crabback,x,y))then
    begin
    mouse
    (x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;

     
    Procedure Findhornwing;
    begin
    if(FindBitmap(hornwing,x,y))then
    begin
    mouse
    (x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;

    begin
    SetupSRL
    ;
    Loadhorn2;
    Loadcrab5;
    Loadcrabback;
    repeat 
    Findhorn2
    ;
    Findcrab5;
    Findcrabback;
    until(false)
    end
    Try that one. Also, it may be because your using the wrong syntax for findbitmap. I don't know beyond that, sorry dude .

  7. #7
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thnx for all ur help, it is greatly appreciated, i put in what u gave me, and i am getting this error
    Code:
    Line 28: [Error] (17689:11): Unknown identifier 'randx' in script
    maybe i should just stick to my original script, lol...never had any problems with that, maybe what i want to do is just too complicated..thnx again for your help though, any further input would be great.

  8. #8
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Replace all the mouses with this:

    mouse(x,y,3,3,true)

    when you want to left click.

    And this:

    mouse(x,y,3,3,false)

    for right click. , Hope this helps i'm just trying to contribute as much as possible.

  9. #9
    Join Date
    Dec 2006
    Location
    Ky
    Posts
    390
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What you had

    Procedure Findcrab5;
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    mouse(x,y,randx,randy,boolean)
    wait(5000);
    end else
    end;

    What it should be

    Procedure Findcrab5;
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    mouse(x,y,1,1,boolean) {doesn't have to be a 1, can be any number}
    wait(5000);
    end else
    end;

    What I did
    Notice there was randx, randy standing for random x and random y
    You want to place a number here to add to the value of the x and y integer that way you won't click the same place each time.
    SUMMER BREAK be back when I want to

  10. #10
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so thnx u both very much, it works great, now any suggestions for the f keys?...right now to use the f keys i am running actools..but running the game and both macro progs is sucking up my processor(two 500mhz pentium 3's,server tower...ima a poor bastard..lol)...so again any help appreciated...and thnx for explaining the method instead of giving me the answer out right.

  11. #11
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try this:

    Procedure Findcrab5;
    begin
    if (isfkeydown(1)) Then
    begin
    if(FindBitmap(crab5,x,y))then
    begin
    mouse(x,y,1,1,boolean) {doesn't have to be a 1, can be any number}
    wait(5000);
    end else
    end;
    end;

    What i did:

    Added if IsFKeyDown(1)then in.

    What that does:

    It will start that procedure if f1 is down . Just do that for the rest of them.

  12. #12
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i understand now that i havent given enough info, sorry for that, all of ur help has been great, what i want to do with the keys as far as script is concernd, is simulate pressing the f keys, the f keys in this game hold items that u can use, for instance, hp potions, food, etc, so instead of checking if the key is down, i want to know if the key can be pressed by the script...just once, in a timed interval...thnx again.

  13. #13
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok

    Do this:

    KeyDown(*number here*);
    Sleep(50)
    KeyUp(*number here*);

    These are the key codes for the fkeys

    F1 - 112
    F2 - 113
    F3 - 114
    F4 - 115
    F5 - 116
    F6 - 117
    F7 - 118
    F8 - 119
    F9 - 120
    F10 - 121
    F11 - 122
    F12 - 123

  14. #14
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay, so i added that to my script, however it wont push the key ingame, only out, for instance if i use f1 key it opens scar help..lol...which may be a sign that i need some..lol..but with ur help i think we r on the right track...also just a question , i assume the number in () is how long it waits before doing KeyUp?
    Code:
    begin
    KeyDown(112);
    Sleep(50)
    KeyUp(112);
    end.
    so i made that by itself to test out, and like i said it presses key outside of game, and i do have game set as client, and set to always on top, i figured that would chngeonce i added to my actual script, however it did not. maybe i added wrong?

  15. #15
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm.... Nope, there's nothing wrong with the code there, it should work perfectly. Then again i never use hotkeys . Perhaps you can change the hotkeys ingame and use those?

  16. #16
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay...so i chnged the keys, and i added the KeyDown part to a DTM i am working on..however i think my noobiest question so far is how to find x1,y1,x2,y2 coor?
    Code:
    var food,x,y:integer;
    procedure LoadDTM;
    begin
    food := DTMFromString('78DA63DCC7C0C0E0C980025EBCB062F80FA41' +
           '981F83F10306E0232FC51D53C7F6E09A619A17CC6F5402280809A' +
           '0340C28B801A907BDC08A8D941847BB601096F026A0E020977DC6' +
           'A5841F47E20E18CDF1C0079B4207C');
    
    
    if FindDTM(food,x,y,56,182,56,182)then
    begin
    KeyDown(113)
    Sleep(50)
    KeyUp(113);
    end else
    end;
    begin
    LoadDTM;
    repeat LoadDTM;KeyDown;FindDTM;KeyUp;
    until(false)
    end.
    that is what i have so far, but it doesnt seem to find dtm on screen...i think my coor are wrong, i did test the dtm in dtm editor so i know that part is correct...also i am getting an invalid number of parameters when i add the keydown part to the script...u have been extremely helpful man..i hate to keep asking for help but i am learning so much from u..so thnx again...

  17. #17
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem . First of all:

    Do you have MSN or something? Maybe we could work together there and stop spamming this thread, well not really spamming but you know what i mean.

    Second of all:

    I got accepted! I'm a member now woot!!!

  18. #18
    Join Date
    Jan 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    congrats on membership.....yea i got msn...i will send u pm

Thread Information

Users Browsing this Thread

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

Posting Permissions

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