|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 12:48 am
scripting help |
I want to create a script that will teleport my charter again and again until such time as I deselect a button.
While teleporting I want to auto pickup any item in a list of items and portal to another mob incase I get in an area that teleport doesn't work
Syntax
teleport = C teleport vidi
area that I can't teleport out of = Some unknown magic holds you here.
c portal hassan; enter gate
recast spell = You failed. or You lost your concentration.
any help is appericated :)
I wish I understood classes better so I could do this (I think the button needs to be controlled by a class) |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 26, 2002 1:47 am |
#CLASS AutoTeleport {disable}
#VAR LastSpell {}
#TR {You failed.$} {@LastSpell}
#TR {You lost your concentration.$} {@LastSpell}
#TR {Some unknown magic holds you here.} {LastSpell="c portal hassan";@LastSpell}
#TR {A portal opens.$} {enter gate;LastSpell="c teleport vidi";@LastSpell}
#TR {You have been teleported.$} {#ALARM "Teleporter" {+5} {@LastSpell}}
#CLASS 0
#BUTTON 1 {Teleport %if(%trigger(AutoTeleport),on,off)} {#IF (%trigger(AutoTeleport)) {#T- AutoTeleport;#UNTRIGGER Teleporter} {#T+ AutoTeleport;LastSpell="c teleport vidi";@LastSpell}} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {} |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 3:19 am |
Hummm only 1 teleport per click of button I needed unlimited teleports untill button is unselected
any idea how I would get the autograb of stuff and how to set up a var with a list of what I want to get?
any clues? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 26, 2002 5:48 am |
Did you fill in proper phrases for the two triggers "A portal opens" and "You have been teleported"? Wihtout those triggers working it doesn't seal the loop.
As for the auto grab, your mud seems to be a ROM based variant so it should have a full line for each item, and should display the room immediately after teleport. So add these 3 things to the class, and just use the editor to copy in lines to the variable GrabList and fill in the matching shorts in GrabNames. Make sure things are in matching positions.
#VAR GrabList {Example item 1.|Example item 2.}
#VAR GrabNames {item1|item2}
#TR {^({@GrabList})$} {get %item(@GrabNames,%ismember("%1",@GrabList))} |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 6:15 am |
Cool I found the problem I don't get the message "you have been teleported" :(
tried triggering of zmuds echo of c teleprot vidi but then the miscasts double it up
don't know what to do |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 6:17 am |
quote:
Cool I found the problem I don't get the message "you have been teleported" :(
tried triggering of zmuds echo of c teleprot vidi but then the miscasts double it up
O on a small note the button never goes on? (the text always says teleporter off)
don't know what to do
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 26, 2002 4:34 pm |
Does it display room information after a teleport? If it does then is there some line that is common to that, like exits? Perhaps not. Might be the only way to do it is catch you prompt and compare how much mana you have after issueing the teleport with before and using that as a success indicator. There are always a hundred ways to do anything in zScript, you just to think.
The button is tied to the class name I used, you should check that all the fields in the button resemble how it was posted, I think #BUTTON expands some arguements when issued at the command line. |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 8:48 pm |
Yaaa triggered of exit on the room and with a little modifaction everything works
|
|
|
|
|
|