Sign in to follow this  
Followers 0
wesley57

A working range macro for a game called runescape

8 posts in this topic

#1 ·  Posted (edited)

Hello everyone, just thought I'd share something of mine that I have created, incase someone else wants to use it. I'll give some background into what this is for and how to get it working.

Firstly, this script is made for the online game Runescape, and although macros for it are frowned upon to say the least :">, posting this code here shouldn't do much harm. For those of you who have played the game and know it's locations, this script is designed to be used at the crafting guild goblins. (South of Falador, you stand on the other side of the water where the cows are and shoot over at the 'gobs).

I am in no way an AutoIT expert, but have only learned enough to get what I have needed done - done. So, I really don't know if the way in which I have gotten things to work is the most effecient, BUT it does work very well. I made a newbie char back in June, and ran this on a computer non-stop through July, and was maxed out at 99 range by the beggining of August. This averaged out to be about 300K range experience every day :whistle:

A few other notes for this script to work:

1) You need to disable Java scripting for internet explorer (this way, when the script links directly a game world, you are not redirected back to their main page). Click Tools>Internet Options...>Security Tab>Custom Level, make sure "allow paste operations via script" and "Active scripting" are disabled.

2) Line 17 of the code might need some tinkering. The game window needs to be vertically aligned perfectly to where its supposed to be. The script resizes and moves it according to the given X and Y coordinates. *** The Y coordinate is the one that will need some changing most likely ***. For internet explorer, only have the address bar turned on (turn off standard buttons and any other junk that might push the game window down). With this setup, which is what I used, the Y coordinate should be 0 if you are using it for Free 2 Play, or 86 if you are using Pay to Play. If it still seems to not work and mess up, then the window might still be off target, and i do believe it needs to be exact to the PIXEL :dance:

3) This script isnt perfect, I died about 10 times getting to 99 range. So I suggest if you use this on F2P you keep a close eye on it, and only have stuff that is needed equiped, incase you die. For P2P, just wear a ring of life, this is what I did, and it saved me losing tens of thousands of arrows when I did die.

4) Macroing in runescape is illegal. Jagex bans people if they detect that they are macroing. Hence, I highly reccomend you run this on an expendable noob, and not your main. My noob was banned only recently for macroing, i was using a different script, not this one. I'm not 100% sure how the detected my macro'ing, however, i suspect that it had to do with the fact that i was gaining 1 million a day in magic, and this set off red flags in their macro detection software. Then they probably decided to look into my account history and saw i had been logged in practically 24/7 for a few days straight. I'm not sure on this, its just what i suspect, lol.

5) EDIT: Forgot to mention, you need to have the in-game brightness settings to darkest for the script to function properly.

You can get the script here:

Range_script.au3

Any feedback/interest in this code would be appreciated. I feel pretty good about my script, seeing as i have no programming experience, and thought that I would share it for others to use in the event anyone out there would actually have a use for it :dance:

Edited by wesley57

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$comp1 = 0
....
$comp1 = PixelGetColor(591, 219)

why do you set it to 0 first ? (same goes for other variabals like $X)

and try replacing all the IF THEN's by Switch/Select.

also i dont like IE and would like it if it opend in the DEFAULT BROUWSER

(search the forums for ways)

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites

Thanks for sharing your work! :whistle:

Here are some suggestions:

  • Clicking Cancel on the first InputBox() doesn't actually cancel the script. You might want to look into fixing that.
  • I'm not sure that this will work as you expect:

    Send("{Right up}")
    ; should be?
    send("{RIGHT}{UP}")
  • Lines like Int(Random(0 - 2, 0 + 8)) can be simplified to Random(-2, 8, 1). Check out the final parameter to Random().
  • The RunWorld() and RunWorld2() functions look like they could be optimised a fair bit. It looks like the URL is decided via $x and then a series of window commands are then issued. You could use Select..EndSelect to store the URL to a variable and then have one single block of code after that which does this:

    Run("C:\Program Files\Internet Explorer\iexplore " & $url)
    WinWait("RuneScape Game - Microsoft Internet Explorer", "", 30)
    WinActivate("RuneScape Game - Microsoft Internet Explorer", "",)
    WinWaitActive("RuneScape Game - Microsoft Internet Explorer", "", 30)
    WinMove("RuneScape Game - Microsoft Internet Explorer", "", "0", "0", "800", "766")
I also like the look of w0uter's suggestions as I don't use IE myself (in fact by default I have my firewall disallow access to it).

Share this post


Link to post
Share on other sites

How are you moving around?

I noted when I tried moving around the little minimap would shift around and I'd lose track of where I was.

Also, code like this can be done in a loop:

Func makesureimfighting()

;; -- ;; Sleep(2000)

Do

  $01checkrunes01 = PixelGetColor(713, 449)  ; 713 to 720  --- 449 to 456

  $01checkrunes02 = PixelGetColor(713, 451)

  $01checkrunes03 = PixelGetColor(713, 452)

...

for $i = 451 to X
$checkrunes = PixelGetColor(713,$i)
next

I haven't done AutoIt in a long time, so that's probably wrong. It'll chop your script down to about 10% of what you have now, using loops I mean.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

im sry, but im lost. Can someone please tell me how to set this up? (sry to dig up old topics...)

And can this run with the client that you can dl?

Thanks

Homer


"A man who has never gone to school may steal from a freight car; but if he has a university education, he may steal the whole railroad." - Theodore Roosevelt

Share this post


Link to post
Share on other sites

I keep getting a 404 error, and What do i put into the dialog box that pops up when i start the Script?

Thanks

Homer


"A man who has never gone to school may steal from a freight car; but if he has a university education, he may steal the whole railroad." - Theodore Roosevelt

Share this post


Link to post
Share on other sites

I keep getting a 404 error, and What do i put into the dialog box that pops up when i start the Script?

Thanks

Homer

The prompt asks you in Which world you want to log in to. But I think it only works up to World 22 or so..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0