quest complete trigger problems

Posted by Perrin on Thu 15 Jul 2004 08:25 AM — 11 posts, 40,382 views.

USA #0
Well I am playing on Aardwolf and am tring to combine what would take two regualer triggers giving two messages into one message.

first idea i had was:
Questor tells you 'As a reward, I am giving you [0-9] quest points and [0-9] gold.'
send: (something like) echo %1 qp %2 gold
You get lucky and gain an extra [0-9] quest points.
send echo %1 qp

and get a script to add the 2 diffrent qp ammounts and send it over a channel with the gold number added as well
any ideas would be helpfull thanks in advance.
Amended on Thu 15 Jul 2004 08:27 AM by Perrin
Australia Forum Administrator #1
This came up recently, try reading this page:

http://www.gammon.com.au/forum/?bbsubject_id=4389
USA #2
I did some tinkering and found a string that works as a trigger to do what i want but still need somekind of script to read it.

^Questor tells you \'As a reward\, I am giving you (.*?) quest points and (.*?) gold\.\'$

echo %1qp %2 gold

^You get lucky and gain an extra (.*?) quest points\.$

echo %1 qp
USA #3
Like nick said...
http://www.gammon.com.au/forum/?bbsubject_id=4389
has this exact question.
USA #4
ok i have been fiddling with the script posted on the other thread and can't get it to work (when i hit edit script the page is blank could that have something to do with it?) and a error screen pops up say statement expected error in line.
Amended on Thu 15 Jul 2004 11:46 AM by Perrin
USA #5
What are you doing? You need to check "enable scripting", set it to VBScript, Then Import those triggers (copy/paste, or importXML). No script file involved.

However, those triggers DO use the MCCP bonus as a fairly important line, is there any reason (assuming youre on the same mud) that you DONT have MCCP turned on (and thus arent getting the bonus?) That line made the whole system a lot easier.
USA #6
I have done all that (all ready had all that done)
I keep getting this :

Error Number: -2146827286
Event: Execution of line 1 column 50
Description: Syntax error
Line in error:
setvariable "qpgain", Cint(getvariable("qpgain")+
Called By: Immediate execution

Error Number: -2146827282
Event: Execution of line 1 column 51
Description: Expected ')'
Line in error:
setvariable "qpgain", Cint(getvariable("qpgain")+2
Called By: Immediate execution

the second time it fired i didn't notice because i hit my complete quest macro (recalls/uses recall portal, runs to questor and sends quest complete)and left my keyboard to use restroom and came back it caused mushclient to close the muds window.
USA #7
Hmm. In the first case you are trying to add nothing to the variable, i.e. '+' instead of '+ 1', or whatever you may have intended.

In both cases you are forgettting a ')'. What you are telling it is basically this:

Cint - Convert the following to integer.
( - start with
getvariable("qpgain") + 2 - The value of gpgain + 2

You need to also have:

) - end conversion

someplace in there. In other words:

setvariable "qpgain", Cint(getvariable("qpgain")+2)

or

setvariable "qpgain", Cint(getvariable("qpgain"))+2

Though the second is probably better, since you already know that '+ 2' is an integer. If gpgain for some reason isn't, then you would get another error, as a result of adding 2 to a non-number. You need to fix the first line the same way *and* add the value you want to add to it, which I assume was supposed to be '1':

setvariable "qpgain", Cint(getvariable("qpgain")+1
USA #8
actually, those are supposed to be references to the wildcards. They should be %1 on both accounts.
USA #9
thanks everyone for the help. Flannel even with what you sent me i have to fiddle with to get it to work. for furture refrence this is the set the ended up working.

just realized small typo corrected 12/20/07

<triggers>
<trigger
custom_colour="12"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^Questor tells you \'As a reward, I am giving you (\d{1,}) quest points and (\d{1,}) gold\.\'$"
name="QuestTrig1"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable &quot;goldgain&quot;, %2
setvariable &quot;qpgain&quot;, %1
enabletrigger &quot;QuestTrig2&quot;, 1
enabletrigger &quot;QuestTrig3&quot;, 1
</send>
</trigger>
<trigger
custom_colour="12"
ignore_case="y"
keep_evaluating="y"
match="^You gain an extra (.*?) quest points \'MCCP Bonus\'\.$"
name="QuestTrig3"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable &quot;qpgain&quot;, Cint(getvariable(&quot;qpgain&quot;)+%1)
enabletrigger &quot;QuestTrig2&quot;, 0
enabletrigger &quot;QuestTrig3&quot;, 0
send &quot;gtell Quest Complete: &quot; &amp; getvariable(&quot;qpgain&quot;) &amp; &quot; qp and &quot; &amp; getvariable(&quot;goldgain&quot;) &amp; &quot; gold.&quot;
</send>
</trigger>
<trigger
custom_colour="12"
ignore_case="y"
keep_evaluating="y"
match="^You get lucky and gain an extra (.*?) quest points\.$"
name="QuestTrig2"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable &quot;qpgain&quot;, Cint(getvariable(&quot;qpgain&quot;)+%1)
</send>
</trigger>
</triggers>
Amended on Thu 20 Dec 2007 09:58 AM by Perrin
USA #10
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, December 30, 2007, 8:45 PM -->
<!-- MuClient version 4.14 -->



<muclient>
<plugin
name="quester"
author="Randalthor"
id="cfcbe12cc3b9518a11b1e080"
language="VBscript"
purpose="to keep track of your progress"
save_state="y"
date_written="2007-12-30 20:42:13"
requires="4.14"
version="1.0"
>

</plugin>


<!-- Get our standard constants -->

<include name="constants.vbs"/>

<!-- Triggers -->

<triggers>
<trigger
custom_colour="12"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^Questor tells you \'As a reward, I am giving you (\d{1,}) quest points and (\d{1,}) gold\.\'$"
name="QuestTrig1"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable "goldgain", %2
setvariable "qpgain", %1
enabletrigger "QuestTrig2", 1
enabletrigger "QuestTrig3", 1
world.addtimer "qcd_1", 0, 27, 0, "gtell @Gthree minutes@Y and counting..........@w", 5, ""
world.addtimer "qcd_2", 0, 28, 0, "gtell @ytwo minutes @Yand counting..........@w", 5, ""
world.addtimer "qcd_3", 0, 29, 0, "gtell @Rone @Yminute remaining..........@w", 5, ""
</send>
</trigger>
<trigger
custom_colour="12"
ignore_case="y"
keep_evaluating="y"
match="^You get lucky and gain an extra (.*?) quest points\.$"
name="QuestTrig2"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable "qpgain", Cint(getvariable("qpgain")+%1)
</send>
</trigger>
<trigger
custom_colour="12"
ignore_case="y"
keep_evaluating="y"
match="^You gain an extra (.*?) quest points \'MCCP Bonus\'\.$"
name="QuestTrig3"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable "qpgain", Cint(getvariable("qpgain")+%1)
enabletrigger "QuestTrig2", 0
enabletrigger "QuestTrig3", 0
send "gtell Quest Complete: " &amp; getvariable("qpgain") &amp; " qp and " &amp; getvariable("goldgain") &amp; " gold."
</send>
</trigger>
<trigger
custom_colour="10"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^You gain an extra (.*?) quest points \'MCCP Bonus\'\.$"
name="QuestTrig4"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable "qptotal", Cint(getvariable("qptotal"))+Cint(getvariable("qpgain"))</send>
</trigger>
<trigger
custom_colour="11"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^You gain an extra (.*?) quest points \'MCCP Bonus\'\.$"
name="QuestTrig5"
regexp="y"
send_to="12"
sequence="98"
>
<send>setvariable "goldtotal", Cint(getvariable("goldtotal"))+Cint(getvariable("goldgain"))</send>
</trigger>
<trigger
custom_colour="11"
enabled="y"
match="You . o O ( clear )"
name="logger"
send_to="12"
sequence="100"
>
<send>world.appendtonotepad "aard_quest_log", "Today's total " &amp; getvariable ("goldtotal") &amp; " gold and " &amp; getvariable ("qptotal") &amp; " quest points "

setvariable "goldtotal", 0
setvariable "qptotal", 0 </send>
</trigger>
</triggers>

<!-- Aliases -->

<aliases>
<alias
match="qr"
enabled="y"
sequence="100"
>
<send>enter
run 8s
quest request</send>
</alias>
<alias
match="qc"
enabled="y"
sequence="100"
>
<send>enter
run 8s
quest complete</send>
</alias>
</aliases>

</muclient>