InnerSpace Trigger Service How to ?

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
fippy
GamingTools Subscriber
Posts: 21
Joined: Sat Jan 01, 2005 4:59 am

InnerSpace Trigger Service How to ?

Post by fippy » Tue Mar 29, 2005 7:22 am

I noticed in the release notes for .78
- Triggers service, powered by Blech, added
- AddTrigger, RemoveTrigger commands added (scripts only)

Any examples on how to use this ? Cant find it in the Wiki. I play WoW mainly and am thinking about writing a buff bot but any example would help.

Fippy

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Tue Mar 29, 2005 7:41 am

I didnt get a good chance to put more information in the wiki yet.

If you want to do this in a script, then for the moment, what you want to look at is [[LavishScript:Designing_Scripts]], particularly the "Event Processing" portion. The example is designed for Fury, but other than not having a Speak command will work perfectly fine in IS.

Code: Select all

function RegisterEvents()
{
 ; Add each event
 AddTrigger MyTrigger "@WHO@ kills YOU."
 AddTrigger YouHit "You hit @WHO@ for @DAMAGE@ point@s@ of damage"   
}

function main()
{
  call RegisterEvents
  do
  {
    if !${QueuedCommands}
      WaitFrame
    else
      ExecuteQueued
  }
  while 1
}

;AddTrigger MyTrigger "@WHO@ kills YOU."
function MyTrigger(string Line, string Who)
{
  Speak -sync You have been killed by ${Who}
}

;AddTrigger YouHit "You hit @WHO@ for @DAMAGE@ point@s@ of damage"
function YouHit(string Line, string Who, int Damage)
{
  ; Note that this function only has 3 parameters. the "s" value from the trigger will be ignored!
  Speak You hit ${Who} for ${Damage} damage
}
This was a test script someone used for EQ1 while I was working on the IS trigger system

Code: Select all

function main()
{
  declare status string 0
 
  AddTrigger BeginCastSpell "You begin casting @SPELL@."
  AddTrigger BeginCastTest "You begin casting @SPELL@"
  AddTrigger BeginCastWood "You begin @1@ Skin like Wood."
  AddTrigger AllChat "@blah@"
 
  do
  {
    if !${QueuedCommands}
      WaitFrame
    else
    {
      echo executing queued commands
      ExecuteQueued
    }
  }
  while 1
  echo All done, shouldn't get here
}
 
function BeginCastSpell(string line, string spel)
{
  echo "Casting ${spel}"
}
 
function BeginCastTest(string line)
{
  echo In BeginCastTest
}
 
function BeginCastWood(string line, string doing)
{
  echo In BeginCastWood
}
 
function AllChat(string line)
{
  echo Got ${line}
}
I'll be adding more information and examples to the wiki this week

fippy
GamingTools Subscriber
Posts: 21
Joined: Sat Jan 01, 2005 4:59 am

Post by fippy » Tue Mar 29, 2005 8:16 am

Cool thx for that Lax Ill start playing now and see what I can come up with.

fippy
GamingTools Subscriber
Posts: 21
Joined: Sat Jan 01, 2005 4:59 am

Post by fippy » Tue Mar 29, 2005 9:51 am

Ok how does my script know which logfile it will be using ?

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Tue Mar 29, 2005 9:57 am

Actually, it doesnt. Inner Space doesnt read log files, it's up to game-specific extensions (or simply a log reader extension) to support it. ISXEQ is the only one that does currently.

I should have mentioned this earlier I know :) You can request it be implemented in the extension you're using on ismods of course

fippy
GamingTools Subscriber
Posts: 21
Joined: Sat Jan 01, 2005 4:59 am

Post by fippy » Wed Mar 30, 2005 9:37 am

I am thinking a generic extension with a method of setting which logfile to use would be handy as it could be used for any game that writes to a log file.

Being a bit of a noob as far as C and C++ goes its probably too big a job for me to tackle myself but I wouldnt mind having a go if I had some idea on what would be needed.

Is this even feasible or would there be some level of game specific processing required ? If it is a simple as setting which logfile to use opening the logfile processing lines as they are written then I might have a chance but if it gets too complicated id be knackered.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Wed Mar 30, 2005 1:33 pm

I may be able to add part of the system Fury uses for reading log files, but Inner Space isn't really meant to be a log parser :) Ideally, a game-specific extension such as ISXEQ would read directly from the chat window or such, rather than waiting until the log is written and then reading that. That also gives a higher degree of accuracy -- log files in EQ for example are accurate to 1 second because of the timestamp, and log files in SWG are written like 10 seconds after the fact (or were, when I last tested it a couple years ago).

I would post your request on ISMods, and perhaps someone with a little more knowledge than yourself can add it to an existing extension.

Post Reply