/cast item

For questions regarding conversion of scripts from the old, parm style to the new MQ2Data format. Conversion questions only!

Moderator: MacroQuest Developers

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

/cast item

Post by Falco72 » Thu Apr 29, 2004 5:34 pm

Code: Select all

|||Cast a spell from an item 
Sub ItemCast(icItemName)
   /if (${Debug}==1) /echo Status: botspell.ItemCast, ${cItemName}
   /if (${cItemName.Length}<=0) /return
   /varset SpellSts 0
   /varset Fail 0
   /if (${Me.Sitting}) /stand
   /echo ${icItemName}
   /cast item "${icItemName}"
   :ItemLoop
   /doevents
   /delay 5
   /if (${Me.Casting.ID}) /goto :ItemLoop
/return
This is the code I use to cast from an item and to make it short it do not works anymore after var system change.
The echo give back the right name of the item but to cast it I need to put the "" around the name (at least it was so with the old var system). I have tried both using

Code: Select all

/cast item "${icItemName}"
and using

Code: Select all

/cast item ${icItemName}
but neither works. More, if I use the same command in EQ via command line (using the "" around item name), like

Code: Select all

/cast item "Brown Silk Bridle"
it works fine. Any idea???

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu Apr 29, 2004 7:12 pm

No idea. Just tried it out and it works fine for me. Here is the code I used:

Code: Select all

Sub Main
  /declare Temp string local "Fisherman's Companion"

  /echo ${Temp}
  /cast item ${Temp}

/return
All I can think of is make damn sure that ${icItemName} is the correct string to cast the item and make sure you have the newest zip. :?
Wish I could be more help.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 29, 2004 7:59 pm

Code: Select all

|||Cast a spell from an item 
Sub ItemCast(icItemName) 
   /if (${Debug}==1) /echo Status: botspell.ItemCast, ${icItemName} 
   /if (${icItemName.Length}<=0) /return 
   /varset SpellSts 0 
   /varset Fail 0 
   /if (${Me.Sitting}) /stand 
   /echo ${icItemName} 
   /cast item "${icItemName}" 
   :ItemLoop 
   /doevents 
   /delay 5 
   /if (${Me.Casting.ID}) /goto :ItemLoop 
/return