How To Successfully Save Scripts

View previous topic View next topic Go down

How To Successfully Save Scripts

Post by zb0rnelm0z on Thu Dec 30, 2010 10:41 pm

So I have seen lately, quite a few people have been asking in the support section about scripts that they have saved not coming up when they type ::run rah

So, pretty much, this should explain how to do it successfully so the scripts show up in the ::run rah command.

Firstly,
say you copy a script off the site;
Code:
;Fatigue trainer
;Descrtiption: Fish + kill Black Knight
;Instructions: Start at Fishing Spot
;Author: zb0rnelm0z

;Variables
set($var1, 0) ;will keep track of time
set($var2, 0) ;will keep track of the NPC Killed
set($var3, 0) ;will keep track of NPC choice
set($var4, 0) ;will keep track of Fish caught
set($var5, 0) ;will store the NPC choice as a string

;Draw Custom Info Screen
drawInfo("@whi@Fish Caught: " + $var4, 1, 1)
drawInfo("@whi@NPCs Killed: @yel@" + $var2, 2, 1)
drawInfo("@whi@Fighting For: @yel@" + $var1, 4, 1)

:START:
getOption($var3, "@ora@What Monster Would You Like To Kill at 99 Fatigue?", "Black Knight")
ifVarEqual(0, $var3) set($var5, "@bla@Black Knights")
toggle("show custominfo on") ;turn custom info screen on
trackTime($var1)            ;start keeping track of time

:NPC_Selector:
ifVarEqual(0, $var3) goto(:fish:)

:fish:
useObject(193)
wait(1500)
ifServerMessageContains("You catch a") inc($var4)
ifFatigueEqual(99) goto(:walkto:)
ifFatigueEqual(100) goto(:sleep:)
goto(:fish:)

:walkto:
walkTo(226,649)
wait(400)
ifAt(226,649) goto(:fight:)
goto(:walkto:)

:fight:
attack(66) ;Black Knight
wait(500,1500)
ifFatigueEqual(100) goto(:walkback:)
ifServerMessageContains("You are too tired") inc($var2)
goto(:fight:)

:walkback:
walkTo(225,655)
wait(1000)
ifAt(225,655) goto(:fish:)
goto(:walkback:)

:sleep:
sleep(100)
wait(500)
ifFatigueEqual(100) goto(:sleep:)
goto(:fish:)

For example:
After you copy that code, you will have to paste it into a notepad document. Should look pretty much complete then, after any changes you wish to make to the script have been made, it is as simple as...
File>Save As
Then locate your rahbot scripts folder. Mine would look something like this;
C:\Users\Admin\Desktop\RAHBot 2.2\scripts

When you have found that in your Save As popup window, type in whatever name for the script you wish,
so for the script posted above, I would like to save it as "fatiguer" just so I remember what it does.
So, in the name box, I would type in fatiguer.rah also remember to choose all files or all types as the file type its at the top of the list.





click save, then goto the bot window. Type ::run rah and in there a little black window should pop up with successfully saved scripts, so I would just look for my fatiguer.rah and click it. If started in the correct spot, it should automatically start the script.

Pictures will be added when I get home from my holiday


Last edited by zb0rnelm0z on Sat Jan 08, 2011 8:53 pm; edited 1 time in total

zb0rnelm0z
Leech Cop

Posts : 269
Join date : 2010-12-27

Back to top Go down

Re: How To Successfully Save Scripts

Post by lawlcakes on Fri Dec 31, 2010 7:34 am

good tutorial

lawlcakes
New user

Posts : 83
Join date : 2010-12-20

Back to top Go down

Re: How To Successfully Save Scripts

Post by zb0rnelm0z on Fri Dec 31, 2010 10:41 am

Thanks. Just makes it easier for people, instead of posting every 5 minutes Razz

zb0rnelm0z
Leech Cop

Posts : 269
Join date : 2010-12-27

Back to top Go down

Re: How To Successfully Save Scripts

Post by IceZ on Sat Jan 08, 2011 9:10 am

Few typos. Looks great. Add a few pics if you get bored, and get the forum mod to sticky it.

I won't step on anyone's toes here.

IceZ
Admin

Posts : 239
Join date : 2010-11-30

Back to top Go down

Re: How To Successfully Save Scripts

Post by zb0rnelm0z on Sat Jan 08, 2011 8:26 pm

haha yeah, I just read the few little spelling mistakes just now Razz But I will add pictures when I get home.

Spelling mistakes fixed.

zb0rnelm0z
Leech Cop

Posts : 269
Join date : 2010-12-27

Back to top Go down

Re: How To Successfully Save Scripts

Post by yehhboii on Tue Jan 18, 2011 9:02 am

thanks heaps for that ===]

yehhboii
New user

Posts : 12
Join date : 2011-01-18

Back to top Go down

Re: How To Successfully Save Scripts

Post by lovefoto9 on Tue Jan 25, 2011 6:24 pm

Hmmm don't want to be a dick but me: Hustler made a picture tutorial along time ago, so thanks for making a new one with no pictures and longly worded

lovefoto9
New user

Posts : 20
Join date : 2011-01-12

Back to top Go down

Re: How To Successfully Save Scripts

Post by itzJorden on Sun Mar 06, 2011 5:13 am

This still won't work for me.

itzJorden
New user

Posts : 53
Join date : 2011-03-04

Back to top Go down

Re: How To Successfully Save Scripts

Post by Assburgers on Sun Mar 06, 2011 6:58 am

itzJorden wrote:This still won't work for me.
Serioiusly, have you ever used a computer before?

Assburgers
New user

Posts : 17
Join date : 2011-02-06

Back to top Go down

Re: How To Successfully Save Scripts

Post by itzJorden on Sun Mar 06, 2011 3:52 pm

Assburgers wrote:
Serioiusly, have you ever used a computer before?


I tried every single tutorial on here...

itzJorden
New user

Posts : 53
Join date : 2011-03-04

Back to top Go down

Re: How To Successfully Save Scripts

Post by j0ka on Sat Jul 23, 2011 7:42 pm

It is also not working for me. It shows the scripts as rah files in script folder after i save them. but the ::run rah wont show them when i go to use them. Does the encoding have to be on anything specific when you save it? I have a few options, such as ANSI, Unicode, Unicode big endian, and UTF-8. If someone could please help Id appreciate it! thanks!

j0ka
New user

Posts : 6
Join date : 2011-07-23

Back to top Go down

Re: How To Successfully Save Scripts

Post by notforyou on Sat Jul 23, 2011 8:09 pm

Follow the guide and it will work, don't change settings just leave those at default. If it is not working then your doing it wrong.

notforyou
Admin

Posts : 2939
Join date : 2010-12-18

Back to top Go down

Re: How To Successfully Save Scripts

Post by Taz1337 on Sat Aug 18, 2012 9:56 pm

Mine doesn't work either. It adds the script to the black box.. But when I run it, It does nothing. When I check my "Scripts" folder, Its in a different format.. Its in text and the others are in some other weird format that can't be opened. I'm on mac if any of you have some tips.

Taz1337
New user

Posts : 2
Join date : 2012-08-18

Back to top Go down

Re: How To Successfully Save Scripts

Post by deadHeadedZed on Sun Aug 19, 2012 8:01 pm

Taz make sure you are using M2.3.1.1 version for Mac. The official mac download thread was updated.

Your scripts folder on a mac is located at ~/scripts/
aka
*yourUserName*/scripts/

TextEdit is stupid and by default forces you to save in Rich Text Format, which has extra encoding which will mess up a rah script.

To get around this go to Format>Make Plain Text, then "save as..." and name your file with the extension ".rah"

Move your script from where ever you saved it to the directory mentioned above and start RAHBot. Your scripts should work.

deadHeadedZed
New user

Posts : 288
Join date : 2011-06-12

Back to top Go down

Re: How To Successfully Save Scripts

Post by Sponsored content Today at 3:48 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum