I am having trouble converting some of my script to work with a plugin.
Here's my original code:
Const MST = "a5446bc0345225f2bcdc5ba9" ' ID for "Magnum Script Tools" plugin.
Dim EqItemList
EqItemList = "bweap, lweap, rweap, head, neck, arms, hands, cloak, torso, belt, legs, feet, lring, rring, shield, lhold, rhold"
' ------------------------------------------------------------
Sub EQ_Display_Inventory (thename, theoutput, arrWildcards)
Dim arrItems
Dim EqItem, EqStore
Dim x
arrItems = Split(EQItemList, ", ")
World.Note World.GetVariable("EqTypeStatus")
World.Note " "
For x = LBound(arrItems) to UBound(arrItems)
EqItem = "EQ_" & arrItems(x)
EqStore = "EQstr_" & arrItems(x)
World.Note PadLeft(arrItems(x), 7) & ": " & PadRight(World.GetVariable(EqItem), 30) _
& "[" & World.GetVariable(EQStore) & "]"
Next
For x = 1 to World.GetVariable("TotalExtras")
EqItem = "EQ_x_" & CStr(x)
EqStore = "EQstr_x_" & CStr(x)
World.Note PadLeft("Extra", 7) & ": " & PadRight(World.GetVariable(EqItem), 30) _
& "[" & World.GetVariable(EQStore) & "]"
Next
End Sub
' ------------------------------------------------------------
Here's the new version I am trying to implement:
' ------------------------------------------------------------
Sub EQ_Display_Inventory (thename, theoutput, arrWildcards)
Dim arrItems
Dim EqItem, EqStore
Dim x
arrItems = Split(EQItemList, ", ")
World.Note " " & World.GetVariable("EqTypeStatus")
World.Note "Fix Lvl: " & World.GetVariable("EqFixLevelStatus")
World.Note " "
For x = LBound(arrItems) to UBound(arrItems)
EqItem = "EQ_" & arrItems(x)
EqStore = "EQstr_" & arrItems(x)
World.Note World.CallPlugIn MST, "PadLeft", arrItems(x), CStr(7) _
& ": " & World.CallPlugIn MST, "PadRight", World.GetVariable(EqItem), CStr(30) _
& "[" & World.GetVariable(EQStore) & "]"
Next
For x = 1 to World.GetVariable("EQTotalExtras")
EqItem = "EQ_x_" & CStr(x)
EqStore = "EQstr_x_" & CStr(x)
World.Note World.CallPlugIn MST, "PadLeft", "Extra", CStr(7) & ": " _
& World.CallPlugIn MST, "PadRight", World.GetVariable(EqItem), CStr(30) _
& "[" & World.GetVariable(EQStore) & "]"
Next
End Sub
' ------------------------------------------------------------
Error number: -2146827263
Event: Execution of line 2179 column 31
Description: Expected end of statement
Line in error:
World.Note World.CallPlugIn MST, "PadLeft", arrItems(x), CStr(7) _
Called by: Immediate execution
I'm assuming "World.CallPlugin" is built to only accept one argument?
I'm beginning to wonder if it's really worth keeping a library of short, but common subroutines. Perhaps I should just use an "include" directive in the XML file instead (waste of memory if multiple plugins all use the same include file though). Also, I could just duplicate the routines directly in the script of each plugin... |