auto split

Posted by Brett McLennan on Tue 03 Dec 2002 01:43 PM — 3 posts, 13,586 views.

#0
How can I set up an auto split trigger that skims a percentage of my choosing to work.

i type something like autosplit to turn it on and something like skim 10 to split all but 10%

the trigger would be

mud sends - A death cry echoes from somewhere

Client sends - get coins corpse

mud sends - You get 100 coins from the corpse.

Client sends - split 90 coins


...i know its not ethical, but I play a very evil thief, who's always looking for trouble.

USA #1
Try this: ;)
<aliases>
  <alias
   name="Split_Set"
   script="Split_Set"
   match="autosplit %1"
   enabled="y"
  >
  </alias>
</aliases>

<triggers>
  <trigger
    name="Split_It"
    script="Split_It"
    match="^You get (/d+) coins from the corpse\."
    regexp="y"
    enabled="y"
  >
  </trigger>
  <trigger
    match="^A death cry echoes from somewhere"
    regexp="y"
    enabled="y"
  >
  <send>get coins corpse</send>
  </trigger>
</triggers>

In your script file>

sub Split_It(tname, output, wilds)
  dim temp, perc
  perc = world.getvariable("split_perc")
  temp = Cint((wilds(1) * perc) / 100)
  world.send "split " & temp & " coins"
end sub

sub Split_Set(aname, output, wilds)
  if int(wilds(1)) >= 0 and int(wilds(1)) <= 100 then
    world.setvariable "split_perc",wilds(1)
    world.note "Split set to " & wilds(1) & "%."
  else
    world.colournote "red","black","Must be a number and between 0-100."
  end if
end sub
Australia Forum Administrator #2
The match line should use a backslash for \d, to match on digits, like this:



 match="^You get (\d+) coins from the corpse\."