[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  zMud to MUSHclient Script Conversion

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: zMud to MUSHclient Script Conversion
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Sun 20 Jan 2008 04:40 PM (UTC)  quote  ]
Message
It's not hard to convert back and forth, I think the formula is just ( length_up - current_time) mod total_cycle, I just need to test it to make sure. And if I have it use Bejito's reporting as a standard (he was first, after all), then anyone using my plugin will be able to talk to each other and zMUD users' scripts.

I just need testing time. I got a new job a few months ago, and between training, then vacation, and now travel... well, there has not been terribly much time for mudding.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Sun 20 Jan 2008 07:58 AM (UTC)  quote  ]
Message
One thing I would like to see is communication between other users of this plugin, even if it does not work with the zmud version. I have not looked at the numbers in either plugin, but don't think it would be too hard to do a conversion when reporting, I mean you cracked the "pathing" using different numbers.

I would have converted the original plugin, but I pay no attention to the moons, as I am not even a multi-class nor a tier, so don't enchant things.

-Onoitsu2
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Sun 20 Jan 2008 04:26 AM (UTC)  quote  ]
Message
I fixed my post, so the script currently up should work by pasting it into a text file. I also managed to butt up against the 6000 character limit a few times trying to trim down the file.

Interfacing with Bejito's script is getting entertaining, since we apparently count in opposite directions, as well as using different number sets. Yay modular arithmetic! Anyway, here is the history part of my current version:

Version 2.0

version history:

2.0    - Redid how ticks were tracked.  No more problems with writing notes
       - Added a commented function at the bottom.  Uncomment it if you leave
         the world open but disconnected for long periods of time.
       - Added length of time until next junction in moon:union
       - Hey, I made a graph!
1.1    - Added command to clear the timing data
       - Cleaned up the display of moon:union 
1.0    - Basic functions of moonbot implemented.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Csd132   (6 posts)  [Biography] bio
Date Sat 19 Jan 2008 03:29 AM (UTC)  quote  ]
Message
Thanks Shaun so much!...I really appreciate your help. The script looks and works great. Please post version 2 of the moonbot script whenever you do finish working on it, but this version definitely does everything I wanted it to. Bejito's script had a couple other features like refreshing other people's moon scripts, but I don't need those features anyway.

Again, I can't thank you enough for your help.

For anyone else trying to use this script:

I had a little trouble at first getting it to work, but then I realized that as Shaun mentioned in his last post, IE messes up the formatting when pasting. Thus, IE was reading "&lt;" and "&gt;" and pasting them into the forum as "<" and ">" (which was causing the following error: Element name must start with letter or underscore, but starts with " " (problem in this file)).

To correct this, simply go through the code and replace all "<" and ">" not associated with a keyword flag with "&lt;" or "&gt;" respectively.

A useful post about that (and some other useful information) can be found at http://www.gammon.com.au/forum/?id=7123.

Thanks again, Shaun.
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Fri 18 Jan 2008 04:31 PM (UTC)  quote  ]

Amended on Fri 18 Jan 2008 04:34 PM (UTC) by Shaun Biggs

Message
I cannot apologize enough for the formatting nightmare that is my previous post. Apparently IE doesn't like to display the xml in a way I could just copy/paste like Firefox does. I will check it over when I am at home to make sure that I correctly fixed my posting of the plugin.

Also, on an important note if you are concerned about integrating this with Bejito's plugin... Bejito and I think completely in the opposite direction. We have our counters starting in different places and the iterators count in different directions. Version 1.0 of mine works well (to be honest, I like Bejito's better), but don't expect them to integrate at all. That's what I've been doing with version 2.0 :)

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Fri 18 Jan 2008 04:23 PM (UTC)  quote  ]

Amended on Sun 20 Jan 2008 04:16 AM (UTC) by Shaun Biggs

Message
Sorry, my site went down for quite a while, and now I'm having a rather hard time getting my old host name back. This is also an old version, I don't have access to the new version while I'm at work.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, May 17, 2007, 9:30 AM -->
<!-- MuClient version 4.05 -->

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

<muclient>
<plugin
   name="moonbot"
   author="Balaam"
   id="2349913955dd86427355ad5e"
   language="Lua"
   purpose="moon phase tracker"
   save_state="y"
   date_written="2007-05-17 09:28:14"
   requires="4.05"
   version="1.0"
   >
</plugin>

<!--  Get our standard constants -->

<include name="constants.lua"/>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   group="moons"
   match="--&gt; TICK &lt;--*"
   name="moontick"
   send_to="12"
   sequence="100"
  >
  <send>for i,v in pairs(moons) do
  if moons[i].now ~= nil then
    moons[i].now = (v.now+1) % v.cycle
  end
end
if countdown == nil then
  countdown, countdowndur = nextunion()
else
  countdown = countdown - 1
  if countdown &lt; 1 then
    countdown, countdowndur = nextunion()
    ColourNote("lime", "black", "Three moons are up for "..countdowndur.." ticks!" )
  end
end</send>
  </trigger>
  <trigger
   enabled="y"
   group="moons"
   match="^You notice the (black|grey|white) moon fall in the (ea|we)st.$"
   name="moonsetting"
   regexp="y"
   script="moonsetting"
   sequence="100"
  >
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   match="moon:plot"
   enabled="y"
   group="moontracker"
   send_to="12"
   sequence="100"
  >
  <send>if (moons.black.now == nil ) or
   (moons.grey.now == nil ) or
   (moons.white.now == nil ) then
  Note( "The cycle of one or more moons is unknown.")
else
  plotdata={white={},grey={},black={}}
  for i = 0,69 do
    for m,t in pairs(plotdata) do
      table.insert(t, ((moons[m].now + i ) % moons[m].cycle) &lt; moons[m].up)
    end
  end
  for i,t in pairs(plotdata) do
    local temp = "["
    for _,v in ipairs(t) do
      if v then
        temp = temp.."O"
      else
        temp = temp.."."
      end
    end
    print(temp.."] "..i)
  end
end</send>
  </alias>
  <alias
   match="moon:union"
   enabled="y"
   group="moontracker"
   send_to="12"
   sequence="100"
  >
  <send>print(nextunion())</send>
  </alias>

  <alias
   match="moon:print"
   enabled="y"
   group="moontracker"
   send_to="12"
   sequence="100"
  >
  <send>Note( "Black="..(moons.black.now or "nil")..
        " Grey="..(moons.grey.now or "nil")..
	" White="..(moons.white.now or "nil") )
  </send>
  </alias>
  
  <alias
   match="moon:tick"
   enabled="y"
   group="moontracker"
   send_to="12"
   sequence="100"
  >
  <send>tickgag = not tickgag
  SetVariable( "tickgag", tostring(gagmoon) )
  local temp = "n"
  if tickgag then temp = "y" end
  SetTriggerOption( "moontick", "omit_from_output", temp )
  ColourNote( "white", "black", "Tick gagging set to ",
              "lime",  "black", tostring(tickgag) )
  </send>
  </alias>

  <alias
   match="^moon(bot)?:help"
   send_to="12"
   regexp="y"
   enabled="y"
  >
  <send>  OnPluginInstall()
  ColourNote( "white", "black", "moonbot:help ",
              "lime",  "black", ": You just typed it.  Look what happened." )
  ColourNote( "white", "black", "moon:plot    ",
              "lime",  "black", ": show the moon cycle" )
  ColourNote( "white", "black", "moon:union   ",
              "lime",  "black", ": show time until next union of 3 moons" )
  ColourNote( "white", "black", "moon:tick    ",
              "lime",  "black", ": turn tick gagging on or off" )
  </send>
  </alias>
  
</aliases>

<!--  Script  -->
<script>
<![CDATA[
tickgag = GetVariable( "tickgag" )
if tickgag == nil then
  tickgag = false
else
  tickgag = gagmoon == "true"
  SetTriggerOption( "moontick", "omit_from_output", "y" )
end

moons={black={now=nil,cycle=50,up=13},
       grey={now=nil,cycle=30,up=8},
       white={now=nil,cycle=65,up=17}}

function moonsetting( tname, tstr, wildcards )
  local moon = wildcards[1]
  moons[moon].now = moons[moon].up - 2
end-- moonsetting

function printmoons()
  Note( "Black="..(moons.black.now or "nil")..
        " Grey="..(moons.grey.now or "nil")..
	" White="..(moons.white.now or "nil") )
end

function nextunion()
  if (moons.black.now == nil ) or
     (moons.grey.now == nil ) or
     (moons.white.now == nil ) then
    return nil,nil
  else
    local offset = 0
    while ((moons.white.now + offset) % moons.white.cycle >= moons.white.up) or
          ((moons.black.now + offset) % moons.black.cycle >= moons.black.up) or
          ((moons.grey.now + offset) % moons.grey.cycle >= moons.grey.up) do
      offset = offset + 1
    end
    local duration = 1
    while ((moons.white.now + offset + duration) % moons.white.cycle < moons.white.up) and
          ((moons.black.now + offset + duration) % moons.black.cycle < moons.black.up) and
          ((moons.grey.now + offset + duration) % moons.grey.cycle < moons.grey.up) do
      duration = duration + 1
    end
    return offset,duration
  end
end -- nextunion()

function OnPluginInstall()
  ColourNote( "white", "black", "Plugin ",
              "lime",  "black", GetPluginName(),
              "white", "black", " Version:",
              "lime",  "black", tostring(GetPluginInfo (GetPluginID(), 19)),
              "white", "black", " installed." )
end -- OnPluginInstall

function OnPluginClose()
  ColourNote( "white", "black", "Plugin ",
              "lime",  "black",  GetPluginName(),
	      "white", "black", " closed." )
end -- OnPluginClose

]]>
</script>

</muclient>

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Csd132   (6 posts)  [Biography] bio
Date Fri 18 Jan 2008 06:12 AM (UTC)  quote  ]
Message
Shaun Biggs,

If you wouldn't mind, would you be willing to post your moon tracking plug-in that you created in here? I'm relatively new to Mushclient and so I'm not very good at scripting just yet. I have been trying to do the same thing you said (and convert Bejito's Moonbot script from Zmud to MC), but I haven't really been able to do it.

I admit that part of the problem is that I was never great at coding in Zmud either (aside from basic triggers and aliases), so I don't really fully understand even how the moon class works. I've spent quite a bit of time just reading through that code and trying to display it in such a way as to make sense, but there are far too many nested if statements and commands I don't understand.

If you'd like I can post the moonbot script to this forum. The script itself (for Zmud) can be found at http://mud.alhena.org/scripting/moonbot.zip

I would really appreciate your help. That might actually be a good plug in to add to Venificius's Aardwolf Plugin Zip File. You, Nick, and Venificius have really made my transition to Mushclient a real joy. I've become somewhat dependent on the forum to get things to work and I absolutely love the code you guys have come up with. Thanks so much



[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Wed 05 Sep 2007 04:31 PM (UTC)  quote  ]
Message
Ok, finally finished debugging that gq loss part. Really pathetically stupid error I don't care to admit to making :p Anyway, I've released a beta version on my website http://biggs.is-a-geek.net/~balaam/ under GainMonitor. I have not gotten around to adding any neat things like double xp tracking, voluntary clan taxing and the like, but it works. It even recognizes when you are in note mode and won't do that annoying "gt quest time" thing everyone else seems to enjoy putting into their notes. Instead, it displays the information to the screen only. Colours are also customizable, as is where each information type is displayed.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Bottomfeeder   (42 posts)  [Biography] bio
Date Wed 05 Sep 2007 04:43 AM (UTC)  quote  ]
Message
Oh man, that would be great.

Ono (Venificius on aard) was helping clean out the bugs on the script NeoFryBoy posted on here. I was positive we had it but it falls apart after a day or two for some reason. If you need a tester for your script let me know.

I'm loving your quest mob/quest reporter/level timers and would love to get my hands on more of your handiwork.

Oh, my email is cam_revard@yahoo.com
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Mon 03 Sep 2007 03:26 AM (UTC)  quote  ]
Message
Quote:
It's a conglomeration of Ninja's and Atreidess' monitoring script.

Mine is almost finished and so far it works much better than I had hoped when I started... except for a minor issue with crashing if you kill a gq mob and don't win the gq. As soon as I get that stable, I will release mine. Or I can email it to you if you don't mind that bit of annoyance here and there.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Bottomfeeder   (42 posts)  [Biography] bio
Date Sun 02 Sep 2007 11:42 PM (UTC)  quote  ]
Message
Ono, could I get you to troubleshoot an already converted plugin? It's a conglomeration of Ninja's and Atreidess' monitoring script. Problem is that it fires off about every 3 minutes automatically spamming results.

If you could either fix it to do the hourly report + on level report...or even just the on level/quest report I'd be forever grateful.

I'll shoot it to your email.
[Go to top] top

Posted by Slarin   (1 post)  [Biography] bio
Date Sat 01 Sep 2007 06:48 AM (UTC)  quote  ]

Amended on Sat 01 Sep 2007 06:52 AM (UTC) by Slarin

Message
What We really need is a room sw database. I know zmud has one somewhere.



is in Kerowyn's clan and a user of my bro Onoitsu2's scripts


Kerowyn and Onoitsu2 scripts will work on mushclient using wine on linux i should know i tested it for Onoitsu2 on my linux box and it work pretty well i must add :)
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Thu 30 Aug 2007 12:21 PM (UTC)  quote  ]
Message
It is perfectly safe to install both Mushclient and zMud on the same system, as safe as zMud itself is to install on a system. I say it this way, because I have had an older version of zMud, and its elicense scheme actually kill something in my windows system to where it would not boot any longer. Thankfully I was using a 2 drive method, and all progs and user files were on the 2nd drive, and windows itself was on its own section, so nothing was lost, but still pissed me off to no end.

-Onoitsu2
[Go to top] top

Posted by Kerowyn   USA  (3 posts)  [Biography] bio
Date Thu 30 Aug 2007 11:26 AM (UTC)  quote  ]
Message
Wow! You two have really gone to town with this script. I very much appreciate it.

Since I have a four-day weekend coming up, I will have time to experiment with MUSHclient.

Do you know if it's all right to have MUSHclient and zMUD installed on the same computer? If so, then it will be easier to test.

Again, thanks for all your efforts.

Thanks,

Kerowyn
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Thu 30 Aug 2007 05:20 AM (UTC)  quote  ]

Amended on Thu 30 Aug 2007 05:21 AM (UTC) by Shaun Biggs

Message
Hrm... Also, since Onoitsu wisely had the triggers capture only numbers, there is really no point in all of the tonumber() calls within the triggers' send field. Lua passes a nil value if the variable isn't a number, which will cause the same error if you don't follow it with an 'or 0' or some other error trapping number.

The other problem here is that this does not take into account gold autosplit with your group mates, so depending on if you are the more likely to get the last hit or not, the amount donated may be lower or higher than expected. Campaign and GQ gold is also skipped over... But they are easily captured in the same manor as the first trigger listed.

It is much easier to fight for one's ideals than to live up to them.
[Go to top] 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.


8,341 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]