Gagging a line after a line

Post Reply
Sheia
Posts: 33
Joined: Tue Dec 01, 2009 4:40 am

Gagging a line after a line

Post by Sheia »

So whats the best way to gag the line right after a line is triggered?

For example I have all my tells and chats captured and sent to a miniconsole but the prompt that goes with that line is still showing in the mainwindow, so their getting alittle spammy.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Gagging a line after a line

Post by Heiko »

Depends on the context. In general, you can use tempLineTrigger() to gag x lines after y lines have arrived. However, for prompt gagging, I'd add some code to your prompt trigger that decides if the prompt should be gagged e.g. define a global boolean variable gagPrompt and flag prompt gagging in the respective triggers.
trigger script:

Code: Select all

gagPrompt = true
prompt script:

Code: Select all

if gagPrompt then
    gagPrompt = false; 
    deleteLine()
end

Sheia
Posts: 33
Joined: Tue Dec 01, 2009 4:40 am

Re: Gagging a line after a line

Post by Sheia »

tempLineTrigger() is what I'm looking for, I guess I just need more info on it, not getting how to use it from the manual for some reason. I'll play with it as well and see if I can figure it out.

But thanks very much Heiko!

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: Gagging a line after a line

Post by demonnic »

They're quite handy... lemme see if I can help

tempLineTrigger(1,1, [[deleteLine()]])

would delete the line immediately following the line your trigger matches on, if you put it in the script box for that trigger.


IF you wanted to have some form of check as to whether you should gag the line or not, you could instead do

tempLineTrigger(1, 1, [[gagline()]])

and have

Code: Select all

function gagline()
  if condition then
    deleteLine()
    condition = false
  end
end
in a script somewhere. Then, if you want to gag the line, you set condition to true (you can use whatever variable you want... I'm just using condition as a placeholder) and insert the tempLineTrigger() call. Now, if the line you want to gag always comes 2 lines after the one your trigger fires on, it would be

tempLineTrigger(2, 1, [[gagline()]])

if you wanted to delete 3 lines following the one you trigger on, without checking, it would be:


tempLineTrigger(1, 3, [[deleteLine()]])

... so the first number is "how many lines to wait before starting" and the second is "once started, how many lines do I go for"


I don't know if that helps or not... but if not, ask questions, I'll try again.

Sheia
Posts: 33
Joined: Tue Dec 01, 2009 4:40 am

Re: Gagging a line after a line

Post by Sheia »

Perfect Demonnic! I understand how to use it now. Thanks very much, its in my script and functioning just like I want. :D

EDIT: AND I just figured out that tempLine solves another problem I was having elsewhere, very nice!

Post Reply