; VG_onCraftingAlert(string Text, string AlertID) ; VG_OnIncomingText(string Text, string ChannelNumber, string ChannelName) /* # VG_onCraftingAlert(string Text, string AlertID) # VG_onChangeChunk(string NewChunkX, string NewChunkY) # VG_onStartSwimming() # VG_onStopSwimming() # VG_onConnectionStateChange(string NewConnectionState) # VG_OnPawnSpawned(string ID, string Name, string Level, string Type) # VG_OnPawnDespawned(string ID, string Name) */ atom(script) VG_OnIncomingText(string Text, string ChannelNumber, string ChannelName) { ; This event is fired every time that text get's sent to the client echo "IncomingText ${ChannelNumber} : ${ChannelName} :Text: ${Text}" call Output "$Text" if (${Text.Find[damage]}) { ; Your Spirit Strike I hits Mob Name for XX damage ; Mob Name hits you for XX damage echo "Found damage in text" } elseif (${Text.Find[spell]}) { echo "Found SPELL in text" } } atom(script) VG_OnCraftingAlert(string Text, string AlertID) { ;This event is fired upon every instance that the Vanguard client sends a 'crafting alert'. echo "CraftingAlert ${AlertID} : ${Text}" } function SetOutputFile(string Filename) { declare OutputFile string global "stats-output.log" OutputFile:Set[${Filename}] redirect "${OutputFile}" echo "${Time} Stats Output started" redirect -append "${OutputFile}" echo "=============================================" } function Output(string Message) { redirect -append "${OutputFile}" echo "${Time}::${Message}" } /* addtrigger damage "Your @Spell@ hits @Mob@ for @Damage@ damage" atom damage(string Line, string Spell, string Mob, int Damage) */ function main() { variable int startXP=0 variable int Count=0 variable int CountMod=0 variable settingsetref VGItemSet ; If ISXEQ2 isn't loaded, then no reason to run this script. if (!${ISXVG(exists)}) { return } ;Initialize/Attach the event Atoms that we defined previously declare HomeDir filepath global ${Script.CurrentDirectory} call SetOutputFile "${HomeDir}/stats-output.log" Event[VG_OnIncomingText]:AttachAtom[VG_OnIncomingText] Event[VG_OnCraftingAlert]:AttachAtom[VG_OnCraftingAlert] ;Tell the user that the script has initialized and is running! echo Craft Script Loaded ; Get player data and log to output file: call Output "Name: ${Me.FName}" call Output "Class: ${Me.Class}" call Output "Level: ${Me.Level}" call Output "XP: ${Me.XP} XP%: ${Me.XPPct}" startXP = ${Me.XP} ; This bit of scripting tells the script to "waitframe" over and ; over while ${ISXVG(exists)}. In other words, as long as the ; extension is loaded. do { waitframe } while ${ISXVG(exists)} } function atexit() { ;Remove the event listeners Event[VG_OnIncomingText]:DetachAtom[VG_OnIncomingText] Event[VG_OnCraftingAlert]:DetachAtom[VG_OnCraftingAlert] ;Send a final message telling the user that the script has ended echo stats.iss has stopped. } /* atom(script) EQ2_CastingEnded() { ; This event is fired every time that the player ends the spell casting process echo Finished casting '${EQ2DataSourceContainer[GameData].GetDynamicData[Spells.Casting].ShortLabel}' } atom(script) EQ2_ActorSpawned(string ID, string Name, string Level, string ActorType) { ; This event is fired every time that an Actor Spawns. ; This is just here as an example of how to use the event. You probably wouldn't ; want to echo every spawn since it will spam you. echo New Actor (ID: ${ID}): [Level: ${Level} Type: ${ActorType}] ${Name} } atom(script) EQ2_ActorDespawned(string ID, string Name) { ; This event is fired every time that an Actor Despawns ; This is just here as an example of how to use the event. You probably wouldn't ; want to echo every despawn since it will spam you. echo Actor Despawned (ID: ${ID}) ${Name} } */