Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Need small script help.. nothing major, I just can't remember

Need small script help.. nothing major, I just can't remember

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by David B   USA  (80 posts)  Bio
Date Fri 27 Jun 2003 08:12 AM (UTC)
Message
I have this controler script that lets me give control of my character to a fellow group member.

sub Controler (name, line, wilds)
if wilds (1) = world.getvariable ("Controler") then
world.send wilds (2)
else
world.send "gt ^B" & wilds (1)& ": ^GYou are not my Controller at the moment. Only: " & world.getvariable ("Controler") & " can Control me"
end if
end sub


The only problem with this is it also allows my controler access to certain commands I don't want them to use... I.E. global channels, The muds Configure options, and ofcourse my password(big bad juju!!) What I'd like to do is have it ignore the following commands:

config *, password *, ooc *, ic *, opray *

the trigger is: * tells the group '<my characters name> *'

For some reason I just can't remember how to do this.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Fri 27 Jun 2003 08:18 AM (UTC)
Message
Think the easiest thing to do would have it go into a series of if-then-elseif-etc statements to check for things on the 'banned list' and then have an else which actually sends it.

By doing it individually, you can have a different message for each (a message saying 'youre not authorized to use that command' or whatnot).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Fri 27 Jun 2003 09:04 PM (UTC)
Message
How are you giving control - with a trigger? Sounds a bit dodgy - couldn't someone fake a line with the controller's name on it? I suggest using the chat system - that lets you give control to someone who you authorise. that is much harder to fake. You could also write a plugin script to filter commands as they come in to discard ones you don't want them to do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,566 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.