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 ➜ zMud Script - Mushclient Script

zMud Script - Mushclient Script

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


Pages: 1 2  

Posted by Odomus   (4 posts)  Bio
Date Mon 18 Nov 2002 12:17 AM (UTC)
Message
OK i have this porblem...Someone gave me a ZMud script, for a little one on one game with other people....Now i know there is a way to translate it to a Mushclient scrpit, but I dont seem to understand how to do it. I can give you the script which he uses, i just need it translated, and how do i exactly put it in?

Here is his:

#ALIAS do_score
{
#ECHO @N3
%if( @N3 > 219, allowall, allowmin)
}
#ALIAS allowmin
{
say Your score was @N3, a score of at least 220 was required to win.
#MATH Katyr (@Katyr + 35)
say The current jackpot is @Katyr!}
#ALIAS allowall
{
say &RY&BO&YU &PW&GO&zN&G!give @Katyr coins @RPer
#CAP 1 Runes
#MATH Katyr (0 + 0)}

#TRIGGER
{
&RPer gives you 35 katyr.
}
{
dice 10 28
dice 5 14
}
#TRIGGER
{
* &RPer gives you 35 katyr.
}
{
dice 10 28
dice 5 14
}
#TRIGGER
{
You roll 10 28-sided dice...the result: &%dN1
}
{
}
#TRIGGER
{
You roll 5 14-sided dice...the result: &%dN2
}
{
#MATH N3 (@N1 + @N2)do_score
}


Now if anyone can Help me you can email me the way to do this, or put it up on here... cause i would like to play with others like this. I personally hate zMud, but that is me, i like musclient it is a heck of alot eaiser to use. I dont mean scripts, cause scripts are for advance users, which i want to become one in time.

Thank you in advance for your help.
-Odomus
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #1 on Mon 18 Nov 2002 05:15 AM (UTC)
Message
Translate to zMud I won't touch. lol I tried once and it took 5 days, a post on the zMud forums and an email consultation with Zugg to figure it out.

However.. Lets see if we can manage this. ;)
<triggers>
  <trigger
   enabled="y"
   match="(.*) give you 35 katyr\."
   name="RPer"
   keep_evaluating="y"
   send_to="9"
   sequence="100"
   regexp="y"
  >
  <send>%1</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="(.*) give you 35 katyr\."
   keep_evaluating="y"
   sequence="101"
   regexp="y"
  >
  <send>dice 10 28
dice 5 14</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="You roll 10 28-sided dice...the result\: (.*)\."
   name="N1"
   send_to="9"
   sequence="100"
   regexp="y"
  >
  <send>%1</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   match="You roll 5 14-sided dice...the result\: (.*)"
   name="Disp_score"
   script="Disp_score"
   sequence="100"
   regexp="y"
  >
  </trigger>
</triggers>

In the script>

sub Disp_score (name, output, wilds)
  dim N1, N2
  dim Katyr, temp
  N1 = world.getvariable ("N1")
  N2 = wilds(1)
  N3 = N1 + N2
  if world.getvariable("N3") > 219 then
    Katyr = world.getvariable("Katyr")
    RPer = world.getvariable("RPer")
    world.send "say &RY&BO&YU &PW&GO&zN&G!"
    world.send "give " & Katyr & " coins " & RPer
    world.appendtonotepad Runes, wilds(0)
    world.setvariable "Katyr","0"
  else
    temp = world.getvariable(N3)
    world.send "Your score was " & temp & ", a score of at least 220 was required to win."
    Katyr = Katyr + 35
    world.setvariable "Katyr", Katyr
    world.send "The current jackpot is " & Katyr & "!"
  end if
end sub

If you don't have a script file already, open a notepad, then copy everything after 'In the script>' into the file, save it with a name like "Myscript.vbs" under 'C:\mushclient\scripts'. If you use windows notepad, remember to include the "", or it will save as 'Myscript.vbs.txt'. Then go into the script settings, make sure it is set to vbscript and enabled, then 'Browse' to where you saved the file and select it. You may want to set the part that says 'Recompile if script changes...' to 'Always' as well to make life easier. ;) If you do have a script already, just copy the same stuff into it.

Copy the triggers and use 'paste' in the trigger editor. and assuming my instructions don't confuse you too badly it should work. Note: if you do this backwards mushclient will complain about not being able to find the script it needs to call.
Top

Posted by Odomus   (4 posts)  Bio
Date Reply #2 on Mon 18 Nov 2002 02:27 PM (UTC)
Message
iam sorry iam stupid, i should of taken out all the & cause the &P &R are all the color codes for that mud...I think as i rember right that would change all in which you have done. *sigh* iam so sorry...iam a stupid person *hits self and says stupid stupid stupid*.

How would it be if thoes & signs came out?
Katyr is Gold on our mud...
and the &RY&BO&YU &PW&GO&zN&G! was all color coded for our mud...if taken out YOU WIN can be replaced...sorry didnt say this before.

#ALIAS do_score
{
#ECHO @N3
%if( @N3 > 219, allowall, allowmin)
}
#ALIAS allowmin
{
say Your score was @N3, a score of at least 220 was required to win.
#MATH Katyr (@Katyr + 35)
say The current jackpot is @Katyr!}
#ALIAS allowall
{
say &RY&BO&YU &PW&GO&zN&G!
give @Katyr coins @RPer (#1 YOU WIN instead of &RY&BO&YU &PW&GO&zN&G)
#CAP 1 Runes ( #2 I have clue what This is we don’t have runes on our mud or is this just something the script needs)
#MATH Katyr (0 + 0)}

#TRIGGER
{
&RPer gives you 35 katyr. ( #3 Now in the above @RPer would be the person iam giving the katyr[Which is gold by the wayon our mud but I think you fig that out] that was common sense to me there, but here it is &RPer which would be a Red colored Person in my eyes or did that change???)
}
{
dice 10 28 (#4 On the mud you can type: Dice <Number of dice> <Size of dice> to get a roll like what you put. Ie: You roll 5 14-sided dice...the result: 47, just so you know)
dice 5 14
}

The idea was when a mortal gives me 35 katyr(gold), that it adds it to any current I have in my inv, than say the jackpot is <blah>, then auto rolls dice which they see, then totals it up and give an average, if it is above 220 it will give out the jackpot if it below I just keep the 35 katyr. It is a little something to pass the time that is all and have the mortals have a little fun, and to have the imms muggle with the mortals is all.

Hopefuly i didnt screw anything up really bad.
Thank you so much...I really do appreciate it.
-Odomus
Top

Posted by Odomus   (4 posts)  Bio
Date Reply #3 on Mon 18 Nov 2002 02:52 PM (UTC)
Message
Oh also , the 219 is the average of the 2 rolls of the dice, so when rolled 2 times, he had it so it calculated it and averaged it, so a 5 14 sided die would be max of 70, and a 10 28 sided dice would be 280, added together would be 350, dvided that by 2 would be 175, now noone could get 175 unless your REALLY lucky but that would dbe the max ammount the dice could hold together. So an even average of about lets say 110? So if the average of both dice is equal to or above 110, then they should win. If not then how do i 'say' to them that they lost?

Sorry to not of added it in the previous post, i totally forgot about it.


-Odomus
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #4 on Mon 18 Nov 2002 06:14 PM (UTC)
Message
Hmm.. From what they script you provided seems to do it works like this>

1. Recieve the money.
2. Roll Dice set 1.
3. Roll Dice set 2.
4. Check results to see it above 219.
5. If > 219 then
--Report win, give all money (except 35) to winner and reset jackpot = 0.
else
--Report that they didn't get above 220, add to jackpot and
tell them what the new one is.

In effect, you never return the last 35 they give you. I am not clear how this worked, since the first round the best they could manage is 0, since the jackpot resets when they win, but the money is not added to it until after they lose. This looks like a bug in the original code you provided...

So lets try again.. lol

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, November 18, 2002, 11:31 AM -->
<!-- MuClient version 3.32 -->

<!-- Plugin "Dicer" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Dicer"
   author="kagehi"
   id="050e590cc943b8017ed06928"
   language="VBscript"
   purpose="Rolling dice"
   save_state="y"
   date_written="2002-11-18 11:28:20"
   requires="3.32"
   version="1.0"
   >
<description trim="y">
<![CDATA[
This is based off a zMud script, it rolls dice for a game
]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.vbs"/>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="(.*) give you 35 katyr\."
   name="Setup_Stuff"
   script="Setup_Stuff"
   regexp="y"
   sequence="100"
  >
  <send>dice 10 28
dice 5 14</send>
  </trigger>
  <trigger
   enabled="y"
   match="You roll 10 28-sided dice...the result\: (.*)\."
   name="N1"
   regexp="y"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </trigger>
  <trigger
   match="You roll 5 14-sided dice...the result\: (.*)"
   name="Disp_Result"
   regexp="y"
   script="Disp_Result"
   sequence="100"
  >
  </trigger>
</triggers>

<!--  Script  -->


<script>
<![CDATA[
sub Setup_Stuff (name, output, wilds)
  dim Katyr
  world.setvariable "RPer",wilds(1)
  Katyr = world.getvariable("Katyr")
  Katyr = Katyr + 35
  world.setvariable "Katyr", Katyr
  world.send "say The current jackpot is " & Katyr & "!"
end sub

sub Disp_Result (name, output, wilds)
  dim N1, N2, N3
  dim Katyr, RPer
  N1 = world.getvariable ("N1")
  N2 = wilds(1)
  N3 = N1 + N2 '**
  if N3 > 219 then '**
    Katyr = world.getvariable("Katyr")
    RPer = world.getvariable("RPer")
    world.send "say &RY&BO&YU &PW&GO&zN&G!" '<--- Replace with "say YOU WON!" If zMud handled the
                                            '     coloring, or leave if they are what the mud uses.
    world.send "give " & Katyr & " coins " & RPer
    world.appendtonotepad Runes, wilds(0)
    world.setvariable "Katyr","0"
  else
    world.send "Your score was " & N3 & ", a score of at least 220 was required to win." '**
  end if
end sub
]]>
</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Dicer:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
  World.Note World.GetPluginInfo (World.GetPluginID, 3)
End Sub
]]>
</script> 

</muclient>

The above can be copied into notepad or the like then saved as "Dicer.xml" into c:\program files\mushclient\worlds\plugins. Then just go to File>Plugins, click add, find dicer.xml and load it. Make sure to save your world after, so that the new plugin gets loaded each time. ;)

This 'should' now do what you want and since it is a plugin you don't have to go through all the other stuff I mentioned before to install it. ;)

It doesn't use an average to test from as you said, nor did the original appear to do so, but you would just modify the lines I marked with '** to change it. I also assume that &r is in fact a foreground = red command for the mud and not something zMud used to send such codes, so you can leave that line alone or replace it if I am wrong about the codes.
Top

Posted by Odomus   (4 posts)  Bio
Date Reply #5 on Mon 18 Nov 2002 07:33 PM (UTC)
Message
Well, it worked, it works perfectly now now all i have to do is get people to play, now that you have spelled out to me like iam a baby, it is pretty dang simple. I think all i needed to do was see it formyself and look at the matrix of what it is supposed to do. Thank you very much i really do appreciate it.

-Odomus
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #6 on Mon 18 Nov 2002 11:53 PM (UTC)
Message
The new version of zMud supports VBScript and JavaScript too by the way... God i can't believe how overbloated that program is. I have been using computers for 10 years and programming for 7 and I can't even BEGIN to understand zMud's interface... (Sorry if this isn't the "Flame zMud" thread :P)

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #7 on Tue 19 Nov 2002 01:01 AM (UTC)
Message
Glad to be of help Odomus. ;)



It actually supports javascript and vbscript now Poromenos? Surprising..

I secretly wonder of Zugg isn't someone that used to work for Microsoft, but left to spread evil other places. ;) But seriously, while Nick takes the, "make sure it works and doesn't mess up anything else" approach, while Zugg seems to have taken the, "heh wouldn't this be neat, lets toss it in as well" approach. You can see the result. Though I think sometimes Nick is too cautious in assuming that because something 'can' be done externally it in fact should be.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #8 on Tue 19 Nov 2002 01:43 AM (UTC)
Message
I agree with you, Shadowfyr, in every point made... I think that Zugg doesn't work just by the "hey, it's cool, let's throw it in" approach, but by the "hey, it's cool, let's throw it and everything else that's even remotely pertinent to it while keeping our bad interface and configuration file hiding in."

I really wish MUSHClient had an automapper though :( Even if it was a separate program... zMud's automapper is as hard to use as zMud... it would be nice if there was a mapper as easy to use as MUSHClient...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #9 on Tue 19 Nov 2002 05:30 AM (UTC)
Message
There's actually a problem with most automappers only being able to handle the basic directions (NSEWUD) and any extended directions absolutely wreck the capabilities of the automapper since it can't translate the extended directions. There's also the problem of sadistic builders like myself using teleport traps, transfer mprogs, random exits and "circular" hallways specificly to foil automap capabilities. You'll quickly find even the best mapping programs failing to keep up with even a mildly creative builder.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #10 on Wed 20 Nov 2002 05:29 PM (UTC)
Message
That is due to the fact that even the best (and I use the word quite loosely here) mappers are all too specific on some points and totally unmodifiable within there core. They basically don't take into account situations where they should keep track of the rooms, but not integrate them into the map (such as with a teleport), rooms they can't see and thus should probably ignore or add in some other way (darkness) or pretty much any other unusual situation. They should probably handle things this way>

Load existing map info.
Add any new rooms/data in a different color as 'temporary' ones.
Mark any 'apparent' duplicate rooms in some color that indicates it 'may' be the same one.
Let the user link them permanently or declare that room a duplicate of another (including noting teleports).
Etc.

Some things a smart mapper, especially if the heart of it was a modifyable script, could easilly deal with. Others would require the user to make changes, but as things are most mappers where designed for mud x and assumed they would work with most others. I see no practical reason why one that could pay attention to the same things the user does and make a guess at how things fit together is an impossibility. It is the maze rat AI problem. Do you make one the merely remembers how it got there the last time or one that can predict the likely result of going another direction? Obviously the second option is better, even in a mapper.

Of course having said that.. My last maze rat program that tried to use predictive path finding didn't quite work the way I had planned. lol Still, being able to configure all the options, including valid direction types and having some sort of 'I think this may be the same as that' sort of ability would improve things a great deal over the, 'you moved south to some sort of room with exits x, y and z, ain't I clever for figuring that out?' method. ;)
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #11 on Thu 21 Nov 2002 10:00 AM (UTC)
Message
Predictive pathing is all well and good, *if* it works. Having said that, there are several reasons why automappers do not recognize repeated rooms, and most of them can be summed up very simply: no access to room vnums. Even if the client assigns an internal vnum as you enter each room, the mapper has no practical way to know if you've been in that room before unless it can match it against the map of the room you entered from. This fact alone makes predictive pathing unworkable as an automap function and pretty near eliminates the potential for recognition of teleport traps, circular hallways, randomized exits and the like. In the highly unlikely event anyone ever writes a codebase that allows non-imms access to room vnums, such features would be quite easy to implement in an automapper with a great deal of accuracy, but as this particular code feature has so many things going against it, lets just be safe and say its never going to happen for the very reasons that currently make automappers worthless in a great many instances. No builder with any talent is going to want their carefully designed maze to be easily mapped and negotiated after the first mortal gets lucky enough to stumble thru it and get a guaranteed accurate map.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #12 on Thu 21 Nov 2002 05:44 PM (UTC)
Message
Quite true.. In general though what you are talking about are cases where the user is probably going to get lost as well, and if not, then it 'should' be possible for the mapper to figure it out as well unless all the rooms also have identical descriptions. As for making perfectly accurate maps... There may be a few people that live near each other or share computer networks that trade such, but the mud I play takes a dim view of that kind of info getting out and has site banned a few people dumb enough to try it. Of course they also site banned AOL for having the most excessive number of rule breakers and idiots of any IP too, but that is another issue.

The point is, if a human can figure out where they are, then the mapper should be able to as well by using similar logic. In those cases where even the player doesn't know what is going on you can't expect the mapper to know either, and that is what being able to move links around, etc. is for. That is the point of having new info 'seperate' from the valid and 'known' map. The user can go back and make adjustments and if the teleport is random, the player can tell it to just ignore that link. It is not impossible to make it a decent tool, but I agree that making it perfect would be dificult in the least. It would quite literally have to be an AI that just happened to maintain a map and not a mapper with some AI in it.

A few things would help a lot of them though:

1. Customisation of valid directions (including 'mud speedwalks).
2. Predictive response to fail messages (i.e. don't delete it because the muds response it vague even though the last command wasn't a direction).
3. Auto-suspend mapping (or cache rooms) in cases where the 'expected' room is not the one you are in or you get something like: It's dark and you can't see a thing.
4. Auto-resume (and/or adding of any actual cached rooms) when one that 'seems' to be known is found.

None that I know of do the last 2, most fail on the second item and sadly mushclients limited speedwalk setup fails even on item 1. In general these are the 'major' issues involved in why they often not only don't work well, but sometimes very nearly not at all.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #13 on Fri 22 Nov 2002 01:39 PM (UTC)
Message
Yep, Shadowfyr is right. You would want a mapper for areas you can understand, not for mazes or traps. The MUD i play in allows mapping, and even the area designers try to make their maps very logical... An automapper would be great in that situation...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #14 on Fri 22 Nov 2002 03:51 PM (UTC)
Message
Logical maps not withstanding, where most mappers fail, even in easily understood areas, is on extended directions because there is no *standard* notation for them in speedwalking and the mappers arent programmed with them for that reason. Each mud that uses extended directions either designs their own speedwalk chars for extended directions or says screw it and leaves players to their own devices in designing a way to support extended directions. Until someone decides its a worthwhile effort to design and distribute a universal patch for extended direction support in speedwalking and mapping, mappers will continue to be little more than a novelty item to be used in only the most basic of areas. Customizable directions might ease the problem a bit, but I suspect they would be more difficult to implement successfully that actually doing the univeral patch method. Personally, if I need a map, I break out the graph paper and draw my own with far more accuracy than even the best mapper can accomplish. I also get the added bonus of being able to recognize loopbacks and teleports with ease and adjusting the map with the appropriate notes.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
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.


54,967 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.