Hello, I'm trying to call a sub from another sub. Here's my code:
And I've got ctrl+1 on the keypad set up to send keypad-1 (the alias)
When I do so, I get this error:
I'm not quite exactly sure how to call a sub from another sub with arguments, any ideas?
Quote:
Dim leftsword, rightsword
leftsword = World.GetVariable("varLeftSwd")
rightsword = World.GetVariable("varRightSwd")
Sub En_Aco (a,b,rapier)
Select Case LCase(rapier(1))
Case "left"
World.Send "envenom " & leftsword & " with aconite"
Case "right"
World.Send "envenom " & rightsword & " with aconite"
End Select
End Sub
Sub Keypad_1 (a,b,wildcard)
En_Aco left
En_Cur right
World.Send "dsl " & target
End Sub
<aliases>
<alias
script="keypad_1"
match="^keypad\-1$"
enabled="y"
group="offense"
regexp="y"
ignore_case="y"
keep_evaluating="y"
sequence="100"
>
</alias>
</aliases>And I've got ctrl+1 on the keypad set up to send keypad-1 (the alias)
When I do so, I get this error:
Quote:
Error number: -2146827838
Event: Execution of line 413 column 3
Description: Wrong number of arguments or invalid property assignment: 'left'
Called by: Function/Sub: keypad_1 called by alias
Reason: processing alias ""I'm not quite exactly sure how to call a sub from another sub with arguments, any ideas?