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 ➜ Lua ➜ I need a hand on this script...

I need a hand on this script...

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


Posted by Synzra   (2 posts)  Bio
Date Thu 22 Dec 2005 05:29 PM (UTC)
Message
I had this script from my old mud and Im trying to redo it.(I kinda forgot some of the stuff) I have all the triggers for the mob but what I want it to do is look after the mob is dead and if there is more wait... till the room is cleared then move to the next room. Here is the script...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
<plugin name="AutoXP_Ifgan"
author="Daffy"
language="jscript"
id = "54611e74584c983ca61b9a0f"
purpose = "Ifgantius XP Script"
date_written = "2004-11-13 02:30:00"
date_modified = "2004-11-13 02:30"
version = "1.0"
save_state = "y"
>
<description trim="y">
<![CDATA[
Script to XP in Ifganistan
]]>
</description>
</plugin>
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="*They aren't here.*"
name="NOT_HERE"
regexp="n"
script="DoIfgan"
sequence="100"
group="IfganXP"
>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="* is DEAD!!"
name="IS_DEAD"
regexp="n"
sequence="100"
group="IfganXP"
>
</trigger>

<trigger
enabled="y"
match="* places * into your back. OUCH!*"
name="BSALERT"
sequence="100"
sound="D:\Program Files\Windows NT\Pinball\SOUND36.WAV"
group="BsAlert"
>
</trigger>
<trigger
enabled="y"
match="* tries to backstab you, but misses!*"
name="BSALERT_MISS"
sequence="100"
sound="D:\Program Files\Windows NT\Pinball\SOUND36.WAV"
group="BsAlert"
>
</trigger>
</triggers>
<aliases>
<alias
script="reset"
match="resetifgan"
enabled="y"
ignore_case="y"
>
</alias>

<alias
script="enable"
match="enable IfganXP"
enabled="y"
ignore_case="y"
>
</alias>
<alias
script="disable"
match="disable IfganXP"
enabled="y"
ignore_case="y"
>
</alias>
</aliases>
<script>
<![CDATA[
function OnPluginInstall() {
world.note('\n\n--------------------------------');
world.note('\nNOW RUNNING IFGANTIUS!\n');
world.note('Commands: ');
world.note('\tEnable IfganXP\t| Turns XPing triggers ON.');
world.note('\tDisable IfganXP\t| Turns XPing triggers OFF.');
world.note('\tEnable BsAlert\t| Turns Backstab Alert triggers ON.');
world.note('\tDisable BsAlert\t| Turns Backstab Alert triggers OFF.');
world.note('\tresetifgan\t| Resets script\'s location pointer to beginning of Ifgantius.');
world.note('\n\nXPing AFK IS ILLEGAL! You\'ve been warned!\n');
world.note('--------------------------------\n\n');
}

var step=0;

function DoIfgan(thename, theoutput, wildcardsVB) {

var steprooms = "sssssssssssse nnnnnnnnnnnnnenesensesessssssssssss wnnnnnnnnnnnnssssssssssss wswnwsnwnwnnnnnnnnnnnn*";
tostep = steprooms.charAt(step);
step++;
switch(tostep){
case "X":
world.send("exam gate");
world.DoAfter(5, "");
break;
case "*":
world.note("\nSCRIPT LOOPING!\n");
step = 0;
world.send("");
break;
case " ":
world.send("");
break;
default:
world.send(tostep);
world.send("");
break;
}
}

function enable(thename, theoutput, wildcardsVB) {
wildcards = VBArray(wildcardsVB).toArray();
world.EnableTriggerGroup("IfganXP", true);
world.note("\nIfganXP trigger group enabled.\n");
}

function disable(thename, theoutput, wildcardsVB) {
wildcards = VBArray(wildcardsVB).toArray();
world.EnableTriggerGroup("IfganXP", false);
world.note("\nIfganXP trigger group disabled.\n");
}

function reset(){
step = 0;
world.note("\nRestarting location pointer. Ifgantius RESET!\n");
}
]]>
</script>
</muclient>

Any help would be much appreciated :) Synzra
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 23 Dec 2005 10:45 PM (UTC)
Message
It's not really clear what the problem is. Is it not working? In what way?

- Nick Gammon

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

Posted by Synzra   (2 posts)  Bio
Date Reply #2 on Sat 24 Dec 2005 04:09 PM (UTC)

Amended on Sat 24 Dec 2005 04:11 PM (UTC) by Synzra

Message
Notice this on the script

switch(tostep){
case "X":
world.send("exam gate");
world.DoAfter(5, "");
break;
case "*":
world.note("\nSCRIPT LOOPING!\n");
step = 0;
world.send("");
break;
case " ":
world.send("");
break;
default:
world.send(tostep);
world.send("");
break;


In between the " " were (kill mob), basically what it would do is kill mob every room till it does see one then it stop and kill the mob. Once the room is cleared it goes on the next room doing the same thing.... (k mob) following the step. What I want it to do is follow the path but if there is a mob,stop,clear the room (if mob is present), then go on once it cleared. I cant remember if there is a pause thing when it detect a mob. Heres an example what my mud is showing me....

Front Straight Away
[Exits: north east south]
This is a 4000 ft. straight away. Speeds along here can easily reach 150 or
more miles per hour. You never knew just how hard it was to steer a car going
this fast did you?

(White) #14, Buckshot Jones, leaves you eating his dust.
(White) #28, Ricky Rudd, gets loose coming out of the turn.
(White) #02, Ryan Newman, blows a tire.

I already have all the mob set in my triggers... a ton of different mobs in this particular zone. I dont know if this help any Nick?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 26 Dec 2005 01:14 AM (UTC)
Message
It might be possible to rewrite the script using the "wait for input" ideas I presented a while back. See:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4957

- 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,375 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.