Need a little help if possible.

ACiDXiAN

Active Member
Okay I am looking for a simple yet effective way to do the following. Maybe someone can help me here as I have zero experience writing anything in Lavish/Innerspace/ISXVG.

I would just like a simple bit of code to take a tell and execute a hotkey press or the like on my other account.

I guess a bard woudl be the best example perhaps, I would /tell bard Song2 bard would /playsong Song2

or I could do a /tell Shaman grouprune and shaman would /cast Intercession II

Now I realize it woudl be a text file with some setup in advance thats not an issue with some variables of song2 = /play Song2 etc but I am getting stuck on the actual call to recognize the tell itself on this.


I have tried to pass a VGExecute /playsong "Song of Runspeed" to the game and it doesnt seem to work. I figure I am doign somethign wrong. Essentially all I woudl really like is a way to receive a tell and pass that tell directly to the execute command.

in worst case send /tell Bard /playsong "this is the runspeed" and for the receiver to just sort of echo it to their chat, even a /tell Bard /assist woudl make it be like someone typed in /assist in the chat window.

Is this possible or how hard is it to do. I seem to be stumped on it. Thank you and if mor einfo is needed please feel free as I am not sure I am explaining this correctly.
 

mmoaddict

Original Script Author: VGA
Some Sample Code for playing song

If ${Me.HealthPct}>85 && ${Me.EnergyPct}>90 && !${Me.Effect[${Name1}'s Bard Song - "${RunSong1}"](exists)} && !${Me.Effect[${Name1}'s Bard Song - "${KiteSong1}"](exists)}
{
Call MH_Echo "Playing ${RunSong1}"
Songs[${RunSong1}]:perform
If ${Me.Inventory[${Drum}].CurrentEquipSlot.Equal[None]}
{
Wait 10
Me.Inventory[${Drum}]:Equip
}
Return
}
------------------------------------------
Credit where credit is due.. this is actually some code gleaned from Madhatter. The part you are asking for is "Songs[${RunSong1}]:perform" the other thing you are asking for is a bit more complicated. Cause you need a timer that sees a tell and responds from that tell to do this song. The problem comes in that it will see that tell for a long time and you need it to only do this once reasonably after the tell is sent. There are some examples of this in kbot in the respond to tells section.

------------------------------------------
I would actually do what you are trying to do a bit different. I don't like the tell system as it can be seen sever side for one.. and what are you really trying to accomplish? Running when you are out of combat. So how about something as simple as this.

Set up a value like

assistMember1
warSong1
runSong1
Drum
Lute

If ${Pawn[${assistMember1}].CombatState} > 0
{
Songs[${warSong1}]:perform
If ${Me.Inventory[${Lute}].CurrentEquipSlot.Equal[None]}
{
Wait 10
Me.Inventory[${Lute}]:Equip
}
Return
}
elseIf ${Pawn[${assistMember1}].CombatState} < 1
{
Songs[${runSong1}]:perform
If ${Me.Inventory[${Drum}].CurrentEquipSlot.Equal[None]}
{
Wait 10
Me.Inventory[${Drum}]:Equip
}
Return
}

So now your Bard would play the war song when his assist is in combat but would switch to run song when your main is out of combat. You can throw in a bunch more stuff like. when energy is low play a different song and when health is low play another one. ETC
 

Kazman420

Active Member
You'll want to use the VG_OnIncomingText event to capture tells.. Here's a very quick and crude example to get you started;

Code:
;set up your variables
variable bool NeedSpeed=FALSE
variable bool NeedRune=FALSE

;set up your event
atom(script) VG_Event_OnIncomingText (string Text, string ChannelNumber, string ChannelName)
{
     if ( ${Text.Find["speedsong"]| ) && ( ${ChannelNumber.Find["15"]} )
     {
          NeedSpeed:Set[TRUE]
     }

     if ( ${Text.Find["rune us"]| ) && ( ${ChannelNumber.Find["15"]} )
     {
          NeedRune:Set[TRUE]
     }
}
Channel 15 is the Tell Channel. Keep in mind this does not take into consideration who sent you the tell.. only that the matching word was send on the matching channel.


In the main function of your script, have it check the ${NeedSpeed} variable and call/execute whatever you want to do when its TRUE..

Code:
function main()
do
{
     WaitFrame

     if ${NeedSpeed}
     {
          Songs[Speed Song Name Here]:Perform
          NeedSpeed:Set[FALSE]
     }

     if ${NeedRune}
     {
          Me.Ability[Intercession II]:Use
          NeedRune:Set[FALSE]
     }
}
while ${ISXVG.ConnectionState.Equal[IN_GAME]}
1. Don't forget to attach and detach your atom in the main script.
2. There can be situations where this will not work. Such as perhaps you are already casting a spell? (try adding VGExecute /stopcasting), or your character does not have enough energy/endurance/life to use said ability (put in a ${Me.Ability[Ability Name].EnergyCost} >= ${Me.Energy} or whatnot). You'll definitely want to add more checks and whatnot, to ensure the script works in all situations.
3. As mentioned by mmoaddict, tells are sent through the server. While I personally don't see anything wrong with simple one word commands sent through tells such as "res" and "buff", it can be logged by SoE should they choose to.
4. If number three has you worried, you can always look into using ISXIRC to send commands between multiple computers running innerspace.. But thats a whole different ball game =)

P.S. Bard songs can be a pain in the ass from what I've seen. I don't have a bard, but a guildmate had lots of issues trying to figure out how to set up his script because song names have quotes around them. I'm not 100% sure that :perform method will work, and you may need to mess with VGExecute /playsong.. The fun part is messing with the innerspace syntax to escape the quotes by prepending with a \ hehe.. For example (taken directly from the InnerSpace Command Syntax page);

Code:
echo "\ "Hi my name is Joe\\\""
will output exactly this, including the quotes:
Code:
"Hi my name is Joe\"
Anyway... that should be enough to get you started =)
 

ACiDXiAN

Active Member
Thank you very much. I have it working VERY nicely now, in combat it comabt songs, swithces to weapon and one handed lute, oout of combat puts them away and equips drum and run song etc. Very helpful code and much appreciated.

I used the autoswitch code instead of the tells option, due to some things MMO pointed out with server side tracking, less fuss and potential to casue hassle to me.
 
Top Bottom