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


Register forum user name Search FAQ

Gammon Forum

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

Cmud Script Conversion

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


Pages: 1 2  

Posted by Kresslack   (70 posts)  [Biography] bio
Date Wed 26 Aug 2009 03:40 AM (UTC)
Message
Hello, someone gave me a fishing script for a game, but it's in Cmud. Can someone convert, or teach me how to convert to Mush please? Thanks for any help in advance.

Part one:


<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="fishing" copy="yes">
    <alias name="tl" autoappend="true" copy="yes">
      <value>tease line</value>
    </alias>
    <trigger priority="2050" copy="yes">
      <pattern>you feel a fish nibbling on your hook</pattern>
      <value>#wait 2000
tease line</value>
    </trigger>
    <trigger priority="2060" copy="yes">
      <pattern>medium strike at your bait</pattern>
      <value>#wait 1850
jerk pole</value>
    </trigger>
    <trigger priority="2070" copy="yes">
      <pattern>small strike at your bait</pattern>
      <value>#wait 1850
jerk pole</value>
    </trigger>
    <trigger priority="2090" copy="yes">
      <pattern>you stagger as a fish</pattern>
      <value>#wait 1850
jerk pole</value>
    </trigger>
    <trigger priority="2100" copy="yes">
      <pattern>you see the watter ripple</pattern>
      <value>#wait 1800
jerk pole</value>
    </trigger>
    <trigger priority="2110" copy="yes">
      <pattern>relaxing the tension on your line</pattern>
      <value>reel line</value>
    </trigger>
    <trigger priority="2120" copy="yes">
      <pattern>You feel the fish tugging on your line</pattern>
      <value>reel line</value>
    </trigger>
    <trigger priority="2130" copy="yes">
      <pattern>but the hook pulls free of the fish</pattern>
      <value>#wait 2000
tease line</value>
    </trigger>
    <trigger priority="2140" copy="yes">
      <pattern>The fish you've hooked struggles</pattern>
      <value>reel line</value>
    </trigger>
    <trigger priority="2160" copy="yes">
      <pattern>The fish tries to swim</pattern>
      <value>reel line</value>
    </trigger>
    <trigger priority="4270" copy="yes">
      <pattern>Your fish struggl</pattern>
      <value>reel line</value>
    </trigger>
    <alias name="bhb" copy="yes">
      <value>take bass from tank
#wait 2100
bait hook with bass
#wait 4000
cls
#wait 4000
tl</value>
    </alias>
    <alias name="cls" copy="yes">
      <value>cast line short</value>
    </alias>
    <alias name="rel" copy="yes">
      <value>reel line</value>
    </alias>
    
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #1 on Wed 26 Aug 2009 03:41 AM (UTC)

Amended on Wed 26 Aug 2009 04:21 AM (UTC) by Nick Gammon

Message
Part two:

<trigger priority="5840" copy="yes">
      <pattern>You quickly jerk back your fishing pole and feel the line go taut</pattern>
      <value>#wait 2400
rel</value>
    </trigger>
    <trigger priority="5850" copy="yes">
      <pattern>As the fish strains your line beyond its breaking point</pattern>
      <value>#wait 4100
bhb</value>
    </trigger>
    <trigger priority="5890" copy="yes">
      <pattern>With a final tug, you finish</pattern>
      <value>#wait 3200
bhb</value>
    </trigger>
    <trigger priority="5980" copy="yes">
      <pattern>You reel in the last bit of line</pattern>
      <value>#wait 3510
bhb</value>
    </trigger>
    <trigger priority="5990" copy="yes">
      <pattern>With a style born of skill, you</pattern>
      <value>#wait 4826
bhb </value>
    </trigger>
    <alias name="sfm" copy="yes">
      <value>gen
#wait 1100
sell hugefish to malusine
#wait 1100
self</value>
    </alias>
    <class name="Gags" copy="yes">
      <trigger priority="5830" copy="yes">
        <pattern>Relaxing the tension on your line, you are able to reel again.$</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5860" copy="yes">
        <pattern>With a short dipping and raising motion, you tease your fishing line.$</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5870" copy="yes">
        <pattern>You quickly jerk back your fishing pole, but the hook pulls free of the fish.$</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5880" copy="yes">
        <pattern>You are already reeling in your fish.</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5900" copy="yes">
        <pattern>You furiously reel in your line, straining to land your fish</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5910" copy="yes">
        <pattern>You move your fishing pole quickly back and forth hoping to excite the interest</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5920" copy="yes">
        <pattern>You tease your fishing line gingerly.$</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5930" copy="yes">
        <pattern>With a slow and steady motion you reel in a length of line, straining against $</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5940" copy="yes">
        <pattern>Jerking the line quickly, you let the fish feel your power as you reel it in. </pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5950" copy="yes">
        <pattern>of line left to bring in.$</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5960" copy="yes">
        <pattern>Playing your fishing pole skilfully, you take up the slack and reel in some $</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="5970" copy="yes">
        <pattern>Your rod bends slightly as your fish tries to escape its barbed tether, running $</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="6180" copy="yes">
        <pattern>With a pull that threatens to rip the pole from your hand, the fish you've $</pattern>
        <value>#gag</value>
      </trigger>
      <trigger priority="6190" copy="yes">
        <pattern>Your fish struggles and swims firmly away from you</pattern>
        <value>#gag</value>
      </trigger>
    </class>
    <trigger priority="6560" copy="yes">
      <pattern>You quickly reel in a</pattern>
      <value>#wait 4264
bhb</value>
    </trigger>
    <class name="counter" copy="yes">
      <trigger priority="9680" copy="yes">
        <pattern>{bass(%d)}</pattern>
        <value>{#math fishweight
{@fishweight + %1}}
</value>
      </trigger>
    </class>
  </class>
</cmud>
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 26 Aug 2009 05:52 AM (UTC)

Amended on Wed 26 Aug 2009 05:57 AM (UTC) by Nick Gammon

Message
Well, this was an interesting one. :)

The script seemed to call out for an automated conversion, so I wrote a little script to run in the Immediate window to do that.

That looks like this:


cmud_script = [=[

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>

... blah blah - the Cmud script from your post goes here ...

</cmud>

]=]

require "getlines"
require "addxml"


function fix_send (send)

  local need_pause = string.match (send, "#wait")
  local script = ""

  if need_pause then
    script = [[
require "wait"
wait.make (function ()
]]
  end -- if


  for line in getlines (send) do
    local time = string.match (line, "#wait (%d+)")
    if time then
      script = script .. string.format ("wait.time (%.1f)\n", time / 1000)
    else
      script = script .. 'Execute ("' .. line .. '")\n'
    end -- if
  end -- for loop

  if need_pause then
    script = script .. "end)"
  end -- if

  return script
end -- fix_send

-- CONVERT ALIASES

count = 0

for alias in string.gmatch (cmud_script, "<alias (.-) </alias>") do
  
  match = assert (string.match (alias, 'name="(%w+)"'), "No match")
  send = assert (string.match (alias, '<value>(.*)</value>'), "No send")

  script = fix_send (send)

  -- add the alias
  
  addxml.alias {  
    match = match, 
    send = script,
    sequence = 100,
    enabled = true,
    name = match,
    send_to = sendto.script,
    group = "fishing"
                 }
  
  count = count + 1
end -- for

print ("added", count, "aliases")

-- CONVERT TRIGGERS

count = 0
for trigger in string.gmatch (cmud_script, "<trigger (.-) </trigger>") do
  
  local omit = false
  local send_to = sendto.script

  match = assert (string.match (trigger, '<pattern>(.-)</pattern>'), "No match")
  send = assert (string.match (trigger, '<value>(.*)</value>'), "No send")
  sequence = assert (string.match (trigger, 'priority="(.-)"'), "No priority")

  if send == "#gag" then
    omit = true
    send_to = sendto.world
    script = ""
  else
    script = fix_send (send)
  end -- if

  -- add the trigger

  count = count + 1
  
  addxml.trigger {  
    match = match, 
    send = script,
    sequence = tonumber (sequence),
    enabled = true,
    name = "fishing" .. count,
    send_to = send_to,
    regexp = "y",
    omit_from_output = omit,
    group = "fishing"
                 }
  
end -- for

print ("added", count, "triggers")


I used a few Lua string matches to do a crude XML parse. This broke up the script into individual aliases and triggers. Then for each one it extracted out the match text, and what to send.

The tricky part was the frequent use of the #wait statement, which I am guessing pauses a CMud script for x milliseconds. We can do something similar in MUSHclient in a script as described here:

Template:post=4957 Please see the forum thread: http://gammon.com.au/forum/?id=4957.


Running the script displayed:


added 5 aliases
added 32 triggers


The resulting aliases were:


<aliases>
  <alias
   name="bhb"
   match="bhb"
   enabled="y"
   group="fishing"
   send_to="12"
   sequence="100"
  >
  <send>require "wait"
wait.make (function ()
Execute ("take bass from tank")
wait.time (2.1)
Execute ("bait hook with bass")
wait.time (4.0)
Execute ("cls")
wait.time (4.0)
Execute ("tl")
end)</send>
  </alias>
  <alias
   name="cls"
   match="cls"
   enabled="y"
   group="fishing"
   send_to="12"
   sequence="100"
  >
  <send>Execute ("cast line short")
</send>
  </alias>
  <alias
   name="rel"
   match="rel"
   enabled="y"
   group="fishing"
   send_to="12"
   sequence="100"
  >
  <send>Execute ("reel line")
</send>
  </alias>
  <alias
   name="sfm"
   match="sfm"
   enabled="y"
   group="fishing"
   send_to="12"
   sequence="100"
  >
  <send>require "wait"
wait.make (function ()
Execute ("gen")
wait.time (1.1)
Execute ("sell hugefish to malusine")
wait.time (1.1)
Execute ("self")
end)</send>
  </alias>
  <alias
   name="tl"
   match="tl"
   enabled="y"
   group="fishing"
   send_to="12"
   sequence="100"
  >
  <send>Execute ("tease line")
</send>
  </alias>
</aliases>


The resulting triggers were:


<triggers>
  <trigger
   enabled="y"
   group="fishing"
   match="you feel a fish nibbling on your hook"
   name="fishing1"
   regexp="y"
   send_to="12"
   sequence="2050"
  >
  <send>require "wait"
wait.make (function ()
wait.time (2.0)
Execute ("tease line")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="medium strike at your bait"
   name="fishing2"
   regexp="y"
   send_to="12"
   sequence="2060"
  >
  <send>require "wait"
wait.make (function ()
wait.time (1.9)
Execute ("jerk pole")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="small strike at your bait"
   name="fishing3"
   regexp="y"
   send_to="12"
   sequence="2070"
  >
  <send>require "wait"
wait.make (function ()
wait.time (1.9)
Execute ("jerk pole")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="you stagger as a fish"
   name="fishing4"
   regexp="y"
   send_to="12"
   sequence="2090"
  >
  <send>require "wait"
wait.make (function ()
wait.time (1.9)
Execute ("jerk pole")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="you see the watter ripple"
   name="fishing5"
   regexp="y"
   send_to="12"
   sequence="2100"
  >
  <send>require "wait"
wait.make (function ()
wait.time (1.8)
Execute ("jerk pole")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="relaxing the tension on your line"
   name="fishing6"
   regexp="y"
   send_to="12"
   sequence="2110"
  >
  <send>Execute ("reel line")
</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You feel the fish tugging on your line"
   name="fishing7"
   regexp="y"
   send_to="12"
   sequence="2120"
  >
  <send>Execute ("reel line")
</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="but the hook pulls free of the fish"
   name="fishing8"
   regexp="y"
   send_to="12"
   sequence="2130"
  >
  <send>require "wait"
wait.make (function ()
wait.time (2.0)
Execute ("tease line")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="The fish you've hooked struggles"
   name="fishing9"
   regexp="y"
   send_to="12"
   sequence="2140"
  >
  <send>Execute ("reel line")
</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="The fish tries to swim"
   name="fishing10"
   regexp="y"
   send_to="12"
   sequence="2160"
  >
  <send>Execute ("reel line")
</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Your fish struggl"
   name="fishing11"
   regexp="y"
   send_to="12"
   sequence="4270"
  >
  <send>Execute ("reel line")
</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Relaxing the tension on your line, you are able to reel again.$"
   name="fishing17"
   omit_from_output="y"
   regexp="y"
   sequence="5830"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You quickly jerk back your fishing pole and feel the line go taut"
   name="fishing12"
   regexp="y"
   send_to="12"
   sequence="5840"
  >
  <send>require "wait"
wait.make (function ()
wait.time (2.4)
Execute ("rel")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="As the fish strains your line beyond its breaking point"
   name="fishing13"
   regexp="y"
   send_to="12"
   sequence="5850"
  >
  <send>require "wait"
wait.make (function ()
wait.time (4.1)
Execute ("bhb")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="With a short dipping and raising motion, you tease your fishing line.$"
   name="fishing18"
   omit_from_output="y"
   regexp="y"
   sequence="5860"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You quickly jerk back your fishing pole, but the hook pulls free of the fish.$"
   name="fishing19"
   omit_from_output="y"
   regexp="y"
   sequence="5870"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You are already reeling in your fish."
   name="fishing20"
   omit_from_output="y"
   regexp="y"
   sequence="5880"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="With a final tug, you finish"
   name="fishing14"
   regexp="y"
   send_to="12"
   sequence="5890"
  >
  <send>require "wait"
wait.make (function ()
wait.time (3.2)
Execute ("bhb")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You furiously reel in your line, straining to land your fish"
   name="fishing21"
   omit_from_output="y"
   regexp="y"
   sequence="5900"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You move your fishing pole quickly back and forth hoping to excite the interest"
   name="fishing22"
   omit_from_output="y"
   regexp="y"
   sequence="5910"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You tease your fishing line gingerly.$"
   name="fishing23"
   omit_from_output="y"
   regexp="y"
   sequence="5920"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="With a slow and steady motion you reel in a length of line, straining against $"
   name="fishing24"
   omit_from_output="y"
   regexp="y"
   sequence="5930"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Jerking the line quickly, you let the fish feel your power as you reel it in. "
   name="fishing25"
   omit_from_output="y"
   regexp="y"
   sequence="5940"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="of line left to bring in.$"
   name="fishing26"
   omit_from_output="y"
   regexp="y"
   sequence="5950"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Playing your fishing pole skilfully, you take up the slack and reel in some $"
   name="fishing27"
   omit_from_output="y"
   regexp="y"
   sequence="5960"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Your rod bends slightly as your fish tries to escape its barbed tether, running $"
   name="fishing28"
   omit_from_output="y"
   regexp="y"
   sequence="5970"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You reel in the last bit of line"
   name="fishing15"
   regexp="y"
   send_to="12"
   sequence="5980"
  >
  <send>require "wait"
wait.make (function ()
wait.time (3.5)
Execute ("bhb")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="With a style born of skill, you"
   name="fishing16"
   regexp="y"
   send_to="12"
   sequence="5990"
  >
  <send>require "wait"
wait.make (function ()
wait.time (4.8)
Execute ("bhb ")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="With a pull that threatens to rip the pole from your hand, the fish you've $"
   name="fishing29"
   omit_from_output="y"
   regexp="y"
   sequence="6180"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="Your fish struggles and swims firmly away from you"
   name="fishing30"
   omit_from_output="y"
   regexp="y"
   sequence="6190"
  >
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="You quickly reel in a"
   name="fishing31"
   regexp="y"
   send_to="12"
   sequence="6560"
  >
  <send>require "wait"
wait.make (function ()
wait.time (4.3)
Execute ("bhb")
end)</send>
  </trigger>
  <trigger
   enabled="y"
   group="fishing"
   match="{bass(%d)}"
   name="fishing32"
   regexp="y"
   send_to="12"
   sequence="9680"
  >
  <send>Execute ("{#math fishweight")
Execute ("{@fishweight + %1}}")
Execute ("")
</send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


It may not be perfect, but you can tweak the script if necessary. You will definitely need to change the last trigger (the one that does #math fishweight) because this needs to be converted to the way MUSHclient does maths in a script. I'll leave that as an exercise. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #3 on Wed 26 Aug 2009 06:24 AM (UTC)
Message
Nick, you are awesome. I've been trying to make this for myself for months now, but the DoAfter commands never seem to work. Quick question though, in the
wait.make (function ()
Do I need to add the action I want it to perform on that certian fire in the second set of parathases, or is this ready to go?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 26 Aug 2009 07:43 AM (UTC)
Message
Kresslack said:

Quick question though, in the
wait.make (function ()
Do I need to add the action I want it to perform on that certian fire in the second set of parathases, or is this ready to go?


It should be ready to go. Take an example:


require "wait"
wait.make (function ()
wait.time (3.5)
Execute ("bhb")
end)


That is passing a function (which doesn't have a name) to wait.make. That wraps it into a coroutine. Basically the end result is that it will wait for 3.5 seconds and then send "bhb".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #5 on Wed 26 Aug 2009 04:39 PM (UTC)
Message
Ah, ok. I just tried it and the triggers don't seem to be firing when I get a strike or nibble.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 26 Aug 2009 09:12 PM (UTC)
Message
Try turning on Game menu -> Trace.

That will confirm if the trigger is matching or not. I tried it and it seemed to work:


you feel a fish nibbling on your hook
TRACE: Matched trigger fishing1

TRACE: Fired timer wait_timer_529
TRACE: Executing timer script "wait.timer_resume"
tease line
They aren't here.


Can you copy and paste the output from the MUD that should have fired the trigger, but didn't? Check that triggers and timers are enabled.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #7 on Wed 26 Aug 2009 09:44 PM (UTC)

Amended on Wed 26 Aug 2009 10:11 PM (UTC) by Kresslack

Message
This is what I got:


TRACE: Matched alias cls
cast line short
You cock back your arm and smoothly cast your line over the railing into the 
TRACE: Matched trigger "@slavenumber"
nearby water. You judge the cast at about 46 feet.
TRACE: Matched trigger "@slavenumber"
2372h, 2124m, 10760e, 11600w e-
TRACE: Matched trigger "@slavenumber"
You feel a fish nibbling on your hook.
TRACE: Matched trigger "@slavenumber"
2372h, 2124m, 10760e, 11600w e-
TRACE: Matched trigger "@slavenumber"
Playing his fishing pole skilfully, Scatter reels in some line.
TRACE: Matched trigger "@slavenumber"
2372h, 2124m, 10760e, 11600w e-
TRACE: Matched trigger "@slavenumber"
You have recovered balance on all limbs.
TRACE: Matched trigger "@slavenumber"
TRACE: Matched trigger "^You have recovered balance on all limbs\.$"


The @slavenumber is part of a script I have plugged in for a quest, don't know why it's firing.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Wed 26 Aug 2009 10:11 PM (UTC)
Message
Well, it would be interesting to see the trigger in question. If it just matches on @slavenumber and has "expand variables" checked, then you need to look at the variable slavenumber.

For example if "slavenumber" was "You" then it would indeed match "You cock back your arm and smoothly cast your line over the railing into the".

One workaround would be to lower the sequence numbers on the fishing triggers. I used the sequences from the Cmud script, in case they were important, but a sequence number of 2060 will be tested for *after* the default, which is 100.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #9 on Wed 26 Aug 2009 10:27 PM (UTC)
Message
These are the triggers with @slavenumber:


  <trigger
   custom_colour="7"
   enabled="y"
   expand_variables="y"
   group="slaving"
   keep_evaluating="n"
   match="@slavenumber"
   regexp="y"
   sequence="100"
  >
  </trigger>

<trigger
   enabled="y"
   group="slaving"
   match="orc lopes (.*)\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>if ( slaving == ("true") ) then
  Send("%1")
  Send("push @slavenumber")
end -- if</send>
  </trigger>



It's not firing on just the cast, it's firing on every single line in the mud, and the fishing triggers just aren't firing at all for some reason.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Wed 26 Aug 2009 10:28 PM (UTC)
Message
What does the variable slavenumber contain? (Look in the Variables world configuration tab).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #11 on Wed 26 Aug 2009 10:37 PM (UTC)

Amended on Wed 26 Aug 2009 10:58 PM (UTC) by Kresslack

Message
There isn't anything in Variables for that. It's in a plugin. I'll e-mail it to you. Still don't understand why the fishing triggers won't fire though.

-Edit-

Tried e-mailing, to long, but the triggers I copied are direct from the script, and there isn't a slave variable. Do you think DoAfter would work?
[Go to top] top

Posted by Kresslack   (70 posts)  [Biography] bio
Date Reply #12 on Wed 26 Aug 2009 11:04 PM (UTC)
Message
I disabled the plugin...and tried to run the fishing again, and the triggers still aren't firing for some reason. So it's not the plugin, I don't know what's up. Does it need to be put into an imported script like a plugin, rather than copy and paste the triggers? Shouldn't matter right?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Thu 27 Aug 2009 12:47 AM (UTC)
Message
It should work if you just paste the triggers in.

Disable all your plugins, turn trace on, and try again (you can simulate the messages by using Game -> Test Trigger).

The trigger fires for me (in the main script file) so they should fire for you too, unless some other trigger fires first.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Thu 27 Aug 2009 12:48 AM (UTC)
Message
Kresslack said:

Do you think DoAfter would work?


If the trigger isn't firing it doesn't really matter what it does. You have to get it to fire first.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


46,509 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] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]