String mismatch error in my plugin..

Posted by Gore on Fri 30 Jun 2006 02:13 PM — 7 posts, 26,210 views.

#0
here's the error:

Quote:
Error number: -2146828275 Event: Execution of line 1323 column 5 Description: Type mismatch: '[string: ""]' Called by: Function/Sub: on_equilibrium called by trigger Reason: processing trigger "trig_equilibrium"


Here's the trigger and subroutine

Quote:
<triggers> <trigger custom_colour="4" enabled="y" group="balances" keep_evaluating="y" match="^You have recovered equilibrium\.$" name="trig_equilibrium" regexp="y" script="on_equilibrium" sequence="100" > </trigger> </triggers> Sub On_Equilibrium (a,b,wildcard) If writhebalance = 1 then entanglement_prompt_check = 1 End If eq = 1 Auto_Sipping ' Subroutine Heal_me ' Subroutine maintain_pipe ' Subroutine, and problem sub i think defup ' Subroutine End Sub


Now I recently added a bunch of stuff to queue pipes.xml, which contains the sub maintain_pipe:

Quote:
<?xml version="1.0" encoding="UTF-8"?> <!-- all aliases for manual pipe using --> <!DOCTYPE aliases> <triggers> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="The pipe has nothing smokeable in it\.$" regexp="y" script="found_empty_pipe" sequence="100" > </trigger> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="There is nothing in the pipe to light\.$" regexp="y" script="found_empty_pipe" sequence="100" > </trigger> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="You carefully light your treasured pipe until it is smoking nicely\.$" regexp="y" script="found_lit_pipe" sequence="100" > </trigger> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="You fill your pipe with (.*?)\.$" regexp="y" script="filled_pipe" sequence="100" > </trigger> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="^Your pipe has gone cold and dark\.$" regexp="y" script="found_unlit_pipes" sequence="100" > </trigger> <trigger enabled="y" group="qh:pipes" keep_evaluating="y" match="A ornately\-carved ivory pipe is full and will hold no more items\.$" regexp="y" script="filled_pipes" sequence="100" > </trigger> </triggers> <!-- Aliases --> <aliases> <alias script="smoke_elm" match="^smoke$" enabled="y" group="qh:pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> </aliases> <aliases> <alias script="set_elm_pipe" match="^addelm (.*?)$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="set_skullcap_pipe" match="^addsku (.*?)$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="set_valerian_pipe" match="^addval (.*?)$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="empty_pipes" match="^emp$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="fill_pipe" match="^fp$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="light_elm" match="^lel$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="light_all_pipes" match="^lp$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="light_skullcap" match="^lsk$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="light_valerian" match="^lva$" enabled="y" group="pipes" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> </aliases> <aliases> <alias script="smoke_elm" match="^sel$" enabled="y" group="healing" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="smoke_sku" match="^ssk$" enabled="y" group="healing" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="smoke_val" match="^sva$" enabled="y" group="healing" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> </aliases> <aliases> <alias script="slow_lock" match="^slow$" enabled="y" group="healing" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> <alias script="slow_lock_restoration" match="^slock$" enabled="y" group="healing" regexp="y" ignore_case="y" keep_evaluating="y" sequence="100" > </alias> </aliases> <script> <![CDATA[
#1
Quote:
dim last_smoked, auto_pipes world.arraycreate "elmpipe" world.arraycreate "valpipe" world.arraycreate "skupipe" world.arrayset "elmpipe", "id", world.getvariable("varPipeElm") world.arrayset "valpipe", "id", world.getvariable("varPipeValerian") world.arrayset "skupipe", "id", world.getvariable("varPipeSkullcap") world.arrayset "elmpipe", "lit", 0 world.arrayset "valpipe", "lit", 0 world.arrayset "skupipe", "lit", 0 world.arrayset "elmpipe", "filled", 1 world.arrayset "valpipe", "filled", 1 world.arrayset "skupipe", "filled", 1 world.arrayset "elmpipe", "artie", world.getvariable("varPipeElmArtifact") world.arrayset "valpipe", "artie", world.getvariable("varPipeValerianArtifact") world.arrayset "skupipe", "artie", world.getvariable("varPipeSkullcapArtifact") auto_pipes = 1 sub smoke_pipe (herb) last_smoked = herb world.send "smoke " & arrayget (last_smoked & "pipe", "id") end sub sub smoke_elm (a,b,wildcard) last_smoked = "elm" world.send "smoke " & arrayget ("elmpipe", "id") end sub sub smoke_val (a,b,wildcard) last_smoked = "val" world.send "smoke " & arrayget ("valpipe", "id") end sub sub smoke_sku (a,b,wildcard) last_smoked = "sku" world.send "smoke " & arrayget ("skupipe", "id") end sub sub Slow_Lock (a,b,wildcard) world.send "smoke " & arrayget("elmpipe", "id") world.send "smoke " & arrayget("elmpipe", "id") world.doafter 1, "smoke " & arrayget("elmpipe", "id") End sub sub Slow_Lock_Restoration (a,b,wildcard) world.send "apply restoration to head" world.send "apply restoration to head" world.doafter 1, "apply restoration to head" End sub sub Fill_pipe (a,b,wildcard) World.Send "outr valerian" World.Send "outr elm" World.Send "outr skullcap" World.Send "put skullcap in " & arrayget("skupipe", "id") World.Send "put elm in " & arrayget("elmpipe", "id") World.Send "put valerian in " & arrayget("valpipe", "id") World.Send "inr valerian" World.Send "inr elm" World.Send "inr skullcap" End sub sub Empty_Pipes (a,b,wildcard) world.send "empty " & arrayget("valpipe", "id") world.send "empty " & arrayget("elmpipe", "id") world.send "empty " & arrayget("skupipe", "id") End sub sub Light_Elm (a,b,wildcard) World.Send "light " & arrayget("elmpipe", "id") End sub sub Light_Valerian (a,b,wildcard) World.Send "light " & arrayget("valpipe", "id") End sub sub Light_Skullcap (a,b,wildcard) World.Send "light " & pipe_sku End sub sub Set_Elm_Pipe (a,b,wildcard) World.SetVariable "varPipeElm", wildcard(1) world.arrayset "elmpipe", "id", wildcard(1) world.note world.getvariable("varPipeEblm") world.colournote "black", "white", "-set elm pipe to " & wildcard(1) & "-" End sub sub Set_Artifact (a,b,wildcard) select case wildcard(1) case "elm" if arrayget("elmpipe", artie) = 1 then world.arrayset "elmpipe", "artie", 0 world.setvariable "varPipeElmArtifact", 0 world.colournote "dimgray", "black", "-pipe: elm " & arrayget("elmpipe", "id") & " set to non-artifact" else world.arrayset "elmpipe", "artie", 1 world.setvariable "varPipeElmArtifact", 1 world.colournote "dimgray", "black", "-pipe: elm " & arrayget("elmpipe", "id") & " set to artifact-" end if case "sku" if arrayget("skupipe", artie) = 1 then world.arrayset "skupipe", "artie", 0 world.setvariable "varPipeskuArtifact", 0 world.colournote "dimgray", "black", "-pipe: skullcap " & arrayget("skupipe", "id") & " set to non-artifact" else world.arrayset "skupipe", "artie", 1 world.setvariable "varPipeSkullcapArtifact", 1 world.colournote "dimgray", "black", "-pipe: skullcap " & arrayget("skupipe", "id") & " set to artifact-" end if case "sku" if arrayget("valpipe", artie) = 1 then world.arrayset "valpipe", "artie", 0 world.setvariable "varPipeValerianArtifact", 0 world.colournote "dimgray", "black", "-pipe: valerian " & arrayget("valpipe", "id") & " set to non-artifact" else world.arrayset "valpipe", "artie", 1 world.setvariable "varPipeValerianArtifact", 1 world.colournote "dimgray", "black", "-pipe: valerian " & arrayget("elmpipe", "id") & " set to artifact-" end if end select end sub
#2
Quote:
sub Set_Valerian_Pipe (a,b,wildcard) World.SetVariable "varPipeValerian", wildcard(1) world.arrayset "valpipe", "id", wildcard(1) world.colournote "black", "white", "-set valerian pipe to " & wildcard(1) & "-" End sub sub Set_Skullcap_Pipe (a,b,wildcard) World.SetVariable "varPipeSkullcap", wildcard(1) world.arrayset "skupipe", "id", wildcard(1) world.colournote "black", "white", "-set skullcap pipe to " & wildcard(1) & "-" End sub sub Light_All_Pipes (a,b,wildcard) if arrayget("valpipe", "artie") = 1 then world.send "light " & arrayget("valpipe", "id") end if if arrayget("skupipe", "artie") = 1 then world.send "light " & arrayget("skupipe", "id") end if if arrayget("elmupipe", "artie") = 1 then world.send "light " & arrayget("elmpipe", "id") end if End sub sub auto_pipes_toggle (a,b,wildcard) if auto_pipes = 1 then auto_pipes = 0 world.colournote "dimgray", "white", "-auto: pipe maintain off-" status_pipes_off elseif auto_pipes = 0 then auto_pipes = 1 world.colournote "dimgray", "white", "-auto: pipe maintain on-" status_pipes_on maintain_pipe end if end sub sub maintain_pipe if auto_pipes = 1 then if arrayget ("elmpipe", "filled") = 0 then fill "elm" end if if arrayget ("valpipe", "filled") = 0 then fill "val" end if if arrayget ("skupipe", "filled") = 0 then fill "sku" end if if arrayget ("valpipe", "lit") = 0 and arrayget("valpipe", "artie") = 0 then light "val" end if if arrayget ("skupipe", "lit") = 0 and arrayget("skupipe", "artie") = 0 then light "sku" end if if arrayget ("elmpipe", "lit") = 0 and arrayget ("elmpipe", "artie") = 0 then light "elm" end if end if end sub sub fill (herb) if auto_pipes = 1 then dim lade lade = herb if herb = "sku" then lade = "skullcap" end if if herb = "val" then lade = "valerian" end if world.send "outr " & lade world.send "put " & lade & " in " & arrayget (herb & "pipe", "id") world.send "inr " & lade end if end sub sub light (herb) if auto_pipes = 1 then world.send "light " & arrayget (herb & "pipe", "id") end if end sub sub found_empty_pipe (a,b,wildcard) world.arrayset last_smoked & "pipe", "filled", "0" world.note last_smoked world.note world.arrayget (last_smoked & "pipe", "filled") world.arrayset "elmpipe", "filled", 0 world.arrayset "valpipe", "filled", 0 world.arrayset "skupipe", "filled", 0 maintain_pipe end sub sub filled_pipes (a,b,wildcard) world.arrayset "elmpipe", "filled", 1 world.arrayset "valpipe", "filled", 1 world.arrayset "skupipe", "filled", 1 light_all_pipes "", "","" end sub sub filled_pipe (a,b,wildcard) world.note wildcard(1) select case wildcard(1) case "slippery elm" world.arrayset "elmpipe", "filled", 1 case "valerian leaf" world.arrayset "valpipe", "filled", 1 case "skullcap flower" world.arrayset "skupipe", "filled", 1 end select end sub sub found_unlit_pipe (a,b,wildcard) world.arrayset last_smoked & "pipe", "lit", 0 world.arrayset "elmpipe", "lit", 0 world.arrayset "valpipe", "lit", 0 world.arrayset "skupipe", "lit", 0 maintain_pipe end sub sub found_unlit_pipes (a,b,wildcard) world.arrayset "elmpipe", "lit", 0 world.arrayset "valpipe", "lit", 0 world.arrayset "skupipe", "lit", 0 maintain_pipe end sub sub found_lit_pipe (a,b,wildcard) world.arrayset "elmpipe", "lit", 1 world.arrayset "valpipe", "lit", 1 world.arrayset "skupipe", "lit", 1 end sub ]]> </script>


Now I added a bunch of changes with the artie parts (added them) but i reloaded a previous version which didn't have those, and it still errors me. Any ideas?

[edit - removed _'s]
Amended on Sat 01 Jul 2006 02:26 AM by Gore
Australia Forum Administrator #3
Quote:

if arrayget ("valpipe", "lit") = 0 and arrayget _("valpipe", "artie") = 0 then


This doesn't look right (and lines nearby). Shouldn't there be a line break after the underscore?
#4
Basically I thought it would kick the rest of that line to the next line, that's why I put the _ in. Also I was tired heh.

    if arrayget ("valpipe", "lit") = 0 and arrayget("valpipe", "artie") = 0 then
      light "val"
    end if
Australia Forum Administrator #5
You are going to have to work out what line 1323 is. Try doing:

/Debug "plugins"

Then from the script listing that scrolls by, work out which line 1323 is.
#6
Thanks, I'll check it out