mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I have a problem with my script, if im on 8 channels it makes me flood out, i dont know if it have to do with this alias or with my custom action, someone that can see any problems with the code? it check if a game is started, if it is it should set me away, it check with a DLL if the game is started or not
Code:
utgoaway {
  if ($away == $false) {
    set %ut-on 1
    unset %ut-tell
    unset %_inputlines
    if (%say-utstst == 1) { set %ut-tell - $uts.eval( [ %uts.com.playing ] ) }
    set %awaymsg Playing Unreal Torurnament %ut-tell
    if (%silentaway == $true) { goto silent }
    set %atime $ctime
    if (%use.awaynick == 1) { set %bnick $me | _awnick }
    set %amiaway on
    writeaslog %tecken 4@ Set to Away mode: $time(HH:nn:ss) $date(mm/dd/yyyy) $chr(91) $+ %awaymsg $+ $chr(93)
    ame is away $([ [ %awaymsg ] ],) since: $chr(91) $+ $time(h:nn:ss tt) $+ $chr(93) l' $+ $group(#logger) - p' $+ $group(#pager) %ad1
    scid -at1 .way away $([ [ %awaymsg ] ],) since: $chr(91) $+ $time(h:nn:ss tt) $+ $chr(93) l' $+ $group(#logger) - p' $+ $group(#pager) %ad1
    halt
    :silent
    set %atime $ctime
    if (%use.awaynick == 1) { set %bnick $me | _awnick }
    set %amiaway on
    writeaslog %tecken 4@ Set to Silent away mode: $time(HH:nn:ss) $date(mm/dd/yyyy) $chr(91) $+ %awaymsg $+ $chr(93)
    grcho Silent Away $chr(91) $+ %awaymsg $+ $chr(93) since: $chr(91) $+ $time(h:nn:ss tt) $+ $chr(93) l' $+ $group(#logger) - p' $+ $group(#pager) %ad1
    scid -at1 .away away $([ [ %awaymsg ] ],) since: $chr(91) $+ $time(h:nn:ss tt) $+ $chr(93) l' $+ $group(#logger) - p' $+ $group(#pager) %ad1
  }
}

and here is my ame alias, i guess it can be coded more clean, but i did the best i could wink
Code:
alias ame {
  var %i = 0
  while (%i < $scon(0)) {
    inc %i 1
    scid %i
    if ($status == connected) { ame_ $1- }
  }
}
alias ame_ {
  var %i 1
  while (%i <= $chan(0)) {
    .describe $chan(%i) $1-
    echo $color(action) $chan(%i) $me $+  $1- 
    inc %i
    haltdef
  }
}

any ideas? :tongue:

--------- Edit

I know i can use if (!$away), but wanted to try if that was the problem, it wasnt..

Last edited by sparta; 25/11/06 04:30 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In your ame_ alias, change
Code:
 .describe $chan(%i) $1- 
to
Code:
 .timer 1 %i .describe $chan(%i) $1- 


That will slow down the messages that are probably doing the actual flooding so they only go at a rate of one per second. If this isn't enough time, or you find that you don't like that long a wait, let me know which and I'll see what I can do about adjusting it.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I found out where the problem are.. this is what i trying to solve:
Code:
utgoaway {
  if ($away == $false) && (%ut-on != 1) {
    echo -a utgoaway1
    set %ut-on 1
    .away test
  }
  else {
    halt
  }
}

utback {
  if ($away == $true) && (%ut-on != 2) {
    echo -a utback1
    set %ut-on 2
    .away
  }
  else {
    halt
  }
}

It dosent notice that im away, ether it see that %ut-on is 1 or 2, it keep on set me away and back, that makes me flood out, so wasnt the my ame alias. tested it with a echo, then i saw where the problem was, and i cant figure out what cosing the script not see it it's away or not, strange behavior :tongue: i use version 6.2 of mirc.. confused


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard