PDA

View Full Version : Scripting For Newbies



Varsus
02-01-2004, 01:36 PM
I would like to thank Kranar for his help (even though he dun know it) in makin this script. I used the standard layout from most of his scripts, to make this one.

This Script will hunt, but the main purpose of it is to show newbie scripters how to make there own scripts.

-Varsus


#Uberness

### Ok I put this together to try and help a few people out in understanding what goes into making a script.
### I tried to explain everything that went on with this scrip so that you could easily go through it and change it for any hunting area.

### NOTE: This Script will actually work if you run it just like this! (Just make sure the messaging is right for you) It starts in TSC and hunts lesser orcs and lesser burrow orcs in landing

### Ok! Lets Get Down to it
### Making A Script!

### I have placed the "instructions / explanation" of the section above the "example" section of each segmant of the script.
### Just Change The info for what you are hunting and it should work fine! (I hope)
### If anyone happens to see something I did wrong, Please tell me so I can change it!

### -Varsus


### Counter set 1 (this lets the script know to put the counter to 1 for the start of the script)

### Example:

counter set 1

### (Ok... Lets Take A Look Around And Start Working!)


### start:
### pause 1 (stop running over youself!)
### put look (so we can see whats going on)
### match filter (Creature your going to be hunting)
### match filter (more than 1 creature type? list both!)
### match readytogo [match for your resting area]
### match logoff [Scripting Violation Limbo] (good thing to have in)
### match logoff [Consultation Lounge] (good thing to have in)
### match logoff [The Cell] (good thing to have in)
### match lost Obvious paths: (so we can get you unlost, great for if you get booted and want to start the script in the middle of your loop)
### match lost Obvious exits: (so we can get you unlost)
### matchwait

### Example:

start:
pause 1
put look
match filter orc
match filter orc.
match continuehunt [Town Square Central]
match logoff [Scripting Violation Limbo]
match logoff [Consultation Lounge]
match logoff [The Cell]
match lost Obvious paths:
match lost Obvious exits:
matchwait

### (So the script says your lost... wow Lets get you unlost)

### start:
### pause 1
### put look
### match filter orc
### match filter orc.
### match continuehunt [Town Square Central]
### match logoff [Scripting Violation Limbo]
### match logoff [Consoltation Lounge]
### match logoff [The Cell]
### match lost Obvious paths:
### match lost Obvious exits:
### matchwait

### (Ok so lets lable the rooms so that the script can find what room we are in!)

### lost:
### Pause .5 (just so we dun run over ourself)
### put look (so it can see where we are at)
### match R1 first couple words of the descrip for room 1
### match R2 first couple words of the descrip for room 1
### match R3 first couple words of the descrip for room 1
### matchwait
### Kind Of Get The Idea? Here! Check Out The Example!

### Example:

lost:
pause .5
put look
match R1 You stand below the top bank of the
match R2 The dirt path ends here. From
match R3 Large stones peeking out of the river
match R4 From here, you can see under the bridge
match R5 The grass waves about you, rustling in the breeze.
match R6 The grass is a bit shorter here as you
match R7 The grass here has died and part of
match R8 Close off to the west, the Reach looms.
match reallost Obvious paths:
matchwait

reallost:
put look
match R9 Still dwarfed by the Reach, you come to a large boulder.
match R10 Close off to the west, the Reach looms.
match R11 A hint of moisture is carried on the air.
match R12 To the northeast, the sound of falling
match R13 The grass lowers to your knees as you
match R14 The rustle of grass off to your left causes you
match R15 A lone, scrawny tree rises up from the
match R16 A large black bird circles overhead
match realreallost Obvious paths:
matchwait

realreallost:
put look
match R17 You are nearly at the opposite end
match R18 A wooden shield lies rotting in the dirt.
match R19 The grass has grown over a small hillock here.
match R20 A small patch of wildflowers decorates
match R21 Beneath your feet, the ground crunches
match R22 You have reached the base of Melgorehn's Reach.
match R23 The walls of the cavern are rough.
match R24 The tunnel leads down, out of the stone
match R25 This narrow room would be ideal for
match R26 The tunnel takes a sharp bend around
matchwait


### Hunt:

### (Enter The Room "Loop" Here ###)

### R(Room Number):
### pause .5
### put (Direction to next room)
### counter set (current room plus 1)
### goto checkroom

### Example: (note ending room moves to the starting room and counter is set to 1)

Hunt:

R1:
pause .5
put s
counter set 2
goto checkroom

R2:
pause .5
put sw
counter set 3
goto checkroom

R3:
pause .5
put w
counter set 4
goto checkroom

R4:
pause .5
put s
counter set 5
goto checkroom

R5:
pause .5
put se
counter set 6
goto checkroom

R6:
pause .5
put w
counter set 7
goto checkroom

R7:
pause .5
put sw
counter set 8
goto checkroom

R8:
pause .5
put s
counter set 9
goto checkroom

R9:
pause .5
put n
counter set 10
goto checkroom

R10:
pause .5
put e
counter set 11
goto checkroom

R11:
pause .5
put e
counter set 12
goto checkroom

R12:
pause .5
put s
counter set 13
goto checkroom

R13:
pause .5
put sw
counter set 14
goto checkroom

R14:
pause .5
put s
counter set 15
goto checkroom

R15:
pause .5
put w
counter set 16
goto checkroom

R16:
pause .5
put s
counter set 17
goto checkroom

R17:
pause .5
put sw
counter set 18
goto checkroom

R18:
pause .5
put n
counter set 19
goto checkroom

R19:
pause .5
put nw
counter set 20
goto checkroom

R20:
pause .5
put n
counter set 21
goto checkroom

R21:
pause .5
put nw
counter set 22
goto checkroom

R22:
pause .5
put go crevice
counter set 23
goto checkroom

R23:
pause .5
put d
counter set 24
goto checkroom

R24:
pause .5
put sw
counter set 25
goto checkroom

R25:
pause .5
put s
counter set 26
goto checkroom

R26:
pause .5
put n
counter set 27
goto checkroom


R27:
pause .5
put ne
counter set 28
goto checkroom


R28:
pause .5
put u
counter set 29
goto checkroom

R29:
pause .5
put go crevice
counter set 30
goto checkroom

R30:
pause .5
put se
counter set 31
goto checkroom

R31:
pause .5
put s
counter set 32
goto checkroom

R32:
pause .5
put se
counter set 33
goto checkroom

R33:
pause .5
put s
counter set 34
goto checkroom

R34:
pause .5
put ne
counter set 35
goto checkroom

R35:
pause .5
put n
counter set 36
goto checkroom

R36:
pause .5
put e
counter set 37
goto checkroom

R37:
pause .5
put n
counter set 38
goto checkroom

R38:
pause .5
put ne
counter set 39
goto checkroom

R39:
pause .5
put n
counter set 40
goto checkroom

R40:
pause .5
put w
counter set 41
goto checkroom

R41:
pause .5
put w
counter set 42
goto checkroom

R42:
pause .5
put ne
counter set 43
goto checkroom

R43:
pause .5
put e
counter set 44
goto checkroom

R44:
pause .5
put e
counter set 45
goto checkroom

R45:
pause .5
put n
counter set 46
goto checkroom

R46:
pause .5
put nw
counter set 47
goto checkroom

R47:
pause .5
put ne
counter set 48
goto checkroom

R48:
pause .5
put n
counter set 1
goto checkexp



### (Ok So You Can Walk Around... Wee Now Lets Find Something To Kill)

### checkroom:

### match start (You Runnin To Fast! Got To Start The Script Over And Get You Unlost)
### match R%c (Messaging For Invalid Move Command (Like theres a big wall east Dummie!)
### match R%c (Messaging that tells you You did something wrong while making this script (Hu?)
### match filter (Critters We Want To Kill)
### match R%c (Messaging at End of Room Descrip)
### match R%c (Messaging at End of Room Descrip (Could Be More Than One Type)
### match R%c (Anything You Don't Want To Deal With (like a troll, Gm...)
### matchwait (Just Put It There.)

### Example:

checkroom:

match start Sorry, you may only type ahead
match R%c You can't go there
match R%c I could not find what
match filter orc
match R%c Obvious paths:
match R%c Obvious exits:
match R%c troll
matchwait




### (Ok So We Gots A Critter In The Room... Lets Make Sure Thats The Only Thing Around)

### filter:

### put look
### match start (Messaging For Invalid Move Command (Like theres a big wall east Dummie!)
### match R%c (Messaging For If Someone Is Already Hunting Here)
### match attack Obvious paths: (Ok So We Alone...)
### match attack Obvious exits: (Yup, Still Alone...)
### matchwait (Just Put It There)

### Example:

filter:
put look
match start You can't go there.
match R%c Also here:
match attack Obvious paths:
match attack Obvious exits:
matchwait




### (We Got A Critter, And Its Alone... SMUSH IT!!)

### attack:

### pause 1
### put att (Creature type)
### match dead (Put Death Messages here)
### match dead (More...)
### match dead (And More...)
### match dead (And More...)
### match attack (Put A Number Of These In, For Messaging Like... You Type TO fast... Creatures Entering Room... Ect)
### match attack (More...)
### match attack (And More...)
### match attack (And More...)
### match R%c (Messaging For Lack of Creature (They Run Away?? NO!)
### match R%c (More...)
### matchwait

### Example:

attack:
pause 1
put att orc
match dead A lesser orc screams one last time and dies.
match dead The lights in a lesser burrow orc's eyes dim and finally go out.
match dead A lesser orc screams
match dead The lights in a lesser burrow
match attack only type ahead
match attack Please wait
match attack A lesser orc grumbles as she hikes in.
match attack A lesser burrow orc pops out of a burrow.
match attack A lesser orc tramps in!
match attack A lesser burrow orc trudges in
match attack Roundtime:
match attack Wait
match attack ...wait
match R%c I could not find
match R%c What were you referring to?
matchwait




### (Ok Lets Skin It)

### dead:

### pause 1
### put sheathe (can't get your skinin knife out with your huntin weapon in the way!)
### waitfor (Messaging For Weapon Going In Your Container)
### put (Command For Getting Skining Knife Out)
### waitfor (Messaging For Skinning Knife Coming From Your Container)
### Put skin (Creature Type)
### match attack (Messaging Your Get If Creature Is Still Alive (for some odd reason)
### match skinned (Messaging For If You Skinned The Creature)
### match continue (Messaging For If You Failed To Skin The Creature)
### match continue (Messaging For If You Try To Skin A Creature That Is Not In The Room)
### match continue (Messaging For If The Creature You Try To Skin Has Already Been Skinned)
### matchwait

### Example:

Dead:
pause 1
put sheathe
waitfor You put a steel-hafted vultite
put get my knife from my pack
waitfor You remove a bone-handled knife
Put Skin Orc
match attack You might want to wait until after it is dead.
match skinned You skinned
match continue You botched
match continue You can only skin creatures!
match continue been skinned.
matchwait




### (Its skinned... Lets Get That Skin!)

### skinned:
### put (command to put your SKINNING KNIFE back in its container)
### waitfor (Messaging For Skining Knife Going back in its container)
### put look (lets check what kinda hides are layin around)
### match getskin1 (First Skin Type)
### match getskin2 (Seccond skin type)
### match theresnoskin (ok so it didn't find any skin lets move on)
### match theresnoskin (ok so it didn't find any skin lets move on)
### matchwait

### getskin1:
### put get (first Skin Type)
### put stow (first skin type)
### match keepitup (messaging for skin going in your container)
### match full (messaging for if your container is full)
### matchwait

### getskin2:
### put get (seccond Skin Type)
### put stow (seccond skin type)
### match keepitup (messaging for skin going in your container)
### match full (messaging for if your container is full)
### matchwait

### Example:

skinned:
put put my knife in my pack
waitfor you put a
put look
match getskin1 orc hide
match getskin2 orc claw
match theresnoskin Obvious paths:
match theresnoskin Obvious exits:
matchwait

getskin1:
put get hide
put stow my hide
match keepitup You put
match full1 Your
matchwait

getskin2:
put get claw
put stow my claw
match keepitup You put
match full2 Your
matchwait




### (Ok, So you skinned it and you got the skin, did it fit in your container?)

### keepitup:
### put unsheathe
### waitfor (message for your main weapon coming out
### put stance adv
### put search (Creature type)
### waitfor (messaging for you searching it)
### put look
### goto checkroom

### full1:
### put drop (first skin type)
### put unsheathe
### waitfor (Messaging Of Main Weapon Coming Out)
### put stance adv
### put look
### goto checkroom

### full2:
### put drop (seccond skin type)
### put unsheathe
### waitfor (Messaging Of Main Weapon Coming Out)
### put stance adv
### put look
### goto checkroom

### Example:

keepitup:
put unsheathe
waitfor You remove a
put stance adv
put search orc
waitfor You search
put look
goto checkroom

full1:
put drop hide
put unsheathe
waitfor You remove a
put stance adv
put look
goto checkroom

full2:
put drop claw
put unsheathe
waitfor You remove a
put stance adv
put look
goto checkroom



### (Its Dead... And You Can't Seem To Skin Anything! Lets Search It!)

### continue:
### put put (command to put your SKINNING KNIFE away)
### waitfor you put a
### put unsheathe
### waitfor (Messaging For Getting Your Main Weapon Out)
### put search (Creature Type)
### waitfor You search
### put look
### goto checkroom

### Example:

continue:
put put my knife in my pack
waitfor you put a
put unsheathe
waitfor you remove a
put search orc
waitfor You search
put look
goto checkroom



### moverest:

### (Enter Moving From Room 1 of the hunting loop to Town Here)
### (Enter Going to furrier and selling Hides, and gems, then back Ect. Here)
### (Make Sure This Section Starts At Room 1 of the hunting loop, and ends at the room you want to rest in)

### Example:

moverest:
put go bridge
move w
move w
move nw
move n
move n
move n
move n
move n
move ne
put go gate
move s
put go shop

### (Ok so now we are in the furrier)
### (Lets take our container off and sell it)
### (Put your weapon away first!)

### put sheathe
### waitfor (messaging of your weapon going in its container)
### put remove (your container)
### waitfor (messaging of you taking container off)
### put sell my (container)
### put wear my (container)
### wait for (messaging of container going on)

### Example:

put sheathe
waitfor you put a steel-hafted
put remove my pack
waitfor you take a
put sell my pack
put wear pack
waitfor You put a

### Ok off to the bank
### Once in the bank, we will use the "deposit all" command to get our coins in the bank
### Example:

move out
move w
move s
move s
move s
put go bank
put go arch
pause 1
put deposit all
pause 1
put go arch
move out

### Ok From Here We Are Going To Go Rest!
### Default Rest Area For This Example Will Be TSC
### once there we will go to our rest command

### goto rest

move east
goto rest

### (LETS REST!)

### rest:
### (sit down if you want)
### (weapon away for faster absorbtion?)
### put sit
### put sheathe
### waitfor (weapon going away messaging)
### Pause (time you want to rest, I try to set it so that my char has 1/4 exp in mind when the pauses are done)
### goto readytogo

### Example:

rest:
put sit
put sheathe
waitfor You put a steel-hafted vultite
Pause 150
Pause 150
Pause 150
Pause 150
Pause 150
goto readytogo

### continuehunt:

### put stance adv
### put stand
### pause 5 (just for the heck of it)
### put unsheathe
### match continuehunt (Messaging For if You already have the weapon out)
### match continuehunt (messaging For you pulling your main weapon out)
### matchwait

### Example:

readytogo:
put stance adv
put stand
pause 5
put unsheathe
match continuehunt You are already holding
match continuehunt You remove a
matchwait

### continuehunt:
### (Enter Moving From Town To Room 1 Here)
### goto checkexp (is it time to rest?)

continuehunt:
move nw
move n
move n
move e
move n
put go gate
move sw
move s
move s
move s
move s
move s
move se
move e
move e
put go br
goto R1



### checkexp:
### put exp
### match moverest (state of mind you want to rest at)
### match moverest (Other state of mind you want to rest at)
### match R1 Your Mind (put this in so that you start hunting again at room 1 on all others)
### matchwait

### Example:

checkexp:
put exp
match moverest Your mind is numbed.
match moverest Your mind can't take much more of this!
match R1 Your Mind
matchwait


### Ok so thats the wrap of it, here are a few extra lines you can incorperate just incase...

### (Ok for some dumb reason the script is telling you to log off... GM?)

### logoff:
### put exit

### Example:

logoff:
put exit



[Edited on 2-1-2004 by Varsus]

HarmNone
02-01-2004, 02:09 PM
That is really cool, Varsus. I am sure it will help a lot of people who would like to know how to script stuff. :)

One little thing I noticed: If the user of this script (as is) does end up getting pulled up to the lounge, it is the Consultation Lounge (not consoltation). As it is now, it will not match. ;)

HarmNone raises a glass of Bailey's to Varsus for a GOOD JOB!

Varsus
02-01-2004, 02:12 PM
Ya someone else told me that to, i would like to think that that part of the script is not needed... but Ill change it, heh

-Varsus

HarmNone
02-01-2004, 02:13 PM
Hee! I guess everyone would like to think that part of the script is unneeded. Personally, I wish it were! :D

HarmNone

Bobmuhthol
02-01-2004, 02:16 PM
Blame Kranar, it's spelled like that in his scripts.

Varsus
02-01-2004, 02:17 PM
Ya I grabbed that strait off the urgh hunter, but its changed now.

-Varsus

HarmNone
02-01-2004, 02:37 PM
I do not see the need to blame anyone, Bob.

HarmNone

Bobmuhthol
02-01-2004, 02:49 PM
I do.

Trinitis
02-01-2004, 02:57 PM
Originally posted by Bobmuhthol
I do.

I see a reason for you to shut the hell up and stop nitpicking people posting.

HarmNone
02-01-2004, 03:03 PM
At risk of hijacking this thread even further, it might be prudent for you to look at it a bit differently, Bob.

Posts that do nothing more than correct spelling and/or grammar, or serve to point out other harmless errors are not useful to these forums in any way. That which is not useful has a tendency to disappear.

HarmNone

Varsus
02-01-2004, 03:05 PM
Bleh, now everyone stop fighting and go take that scripting help I just gave... and go make a script for critters 18-20 and then SEND IT TO ME! heh

-Varsus (Id get up and do it myself... but naw)

HarmNone
02-01-2004, 03:07 PM
Hee! So there was an ulterior motive operating here, eh? ;)

HarmNone

Trinitis
02-01-2004, 03:09 PM
Hehe, I script a lot of things, But I don't script hunt.

Being an empath all the years I've been in GS (along with other classes..) I know the tottal annoy factor of fogging to someone who just died..their group is closed, they don't respond at all. So you bring out a cleric, field raise them, and bam, they go right off scripting again, only to die...again.


Actually, it was a great source of experiece..and I confused the hell outta Khaladon when I told him I was abusing a script abuser..

-Adredrin

HarmNone
02-01-2004, 03:15 PM
Heh. I can almost hear Khaladon now.

"You were doing what to a what? :D

HarmNone

Trinitis
02-01-2004, 03:39 PM
Course, Khaladon had a HELL of a time trying to figure out how I made it from level 1, to level 50 in just a few months in Plat. Its frighting that he actually keeps track of that stuff in plat. Ever sense then, me and him joke around with eachother a lot.

-Adredrin