Im trying to create a script to trigger off a number recieved and then divide that number by 20 then resubmit it as an imput into the mud im playing on. Any help would be very appriciative.
I need help Making A simple Script (Im just dumb and dont know what im doing)
Posted by Tillany on Sat 18 Jun 2005 03:49 AM — 4 posts, 17,678 views.
What does the line recieved look like? And then what do you want to send (just a plain number? or something else infront of it)
The line is simaler to this trigger is
*# 4832652654262 74364*
I want the trigger to divide that second number by 20 then send it back into the mud as...
slice 4832652654262 <new number>
*# 4832652654262 74364*
I want the trigger to divide that second number by 20 then send it back into the mud as...
slice 4832652654262 <new number>
Assuming the asterisks are part of the line, and assuming that you want just the integer part of the quotient, this will work (for any pair of numbers).
It is in VBScript, but the only language sensitive part is the rounding and the syntax.
Just copy and paste into the triggers page.
It is in VBScript, but the only language sensitive part is the rounding and the syntax.
<triggers>
<trigger
enabled="y"
match="^\*# (\d+) (\d+)\*$"
regexp="y"
send_to="12"
sequence="100"
>
<send>note "slice %1 " & Int(%2/20)</send>
</trigger>
</triggers>
Just copy and paste into the triggers page.