This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

TCL needed help

Old posts that have not been replied to for several years.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Hehe, yeah I use pushmode with flushmode alot in my scripts, although I never knew it could be as fast as putquick '-next' or putdccraw. I'll modify my current scripts to enforce it as well.

*user* is a revered one now! :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

Hi guys, I've edited the script but the timer doesn't seems to work, as in the bot doesn't -m after sometime.

Code: Select all

bind splt - * netsplit:lock 
proc netsplit:lock {n u h c {r ""}} { 
global netsplit_lock 
if {![info exists netsplit_lock($c)]} { 
if {![string match *m* [scan [getchanmode $c] %s]]} { 
pushmode $c +m 
puthelp "PRIVMSG $c :Netsplit detected, channel set to +m for 15 secs." 
utimer 15 "list pushmode $c -m" 
} 
set netsplit_lock($c) "#abc" 
utimer 15 "list unset netsplit_lock($c)"
} 
}
Could anyone see what's wrong with the coding?
+ Stealth Box +
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Stealthx wrote:Could anyone see what's wrong with the coding?
Yes...anyone could see it. (Compare your code to mine)
Have you ever read "The Manual"?
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

user wrote:
Stealthx wrote:Could anyone see what's wrong with the coding?
Yes...anyone could see it. (Compare your code to mine)
Thanks for your answer but I've change the [ ] to " ", the reason I've changed is because the timer doesn't work. Although it did +m and -m, but definitely not after the time that the timer (15sec) set

Code: Select all

utimer 15 [list pushmode $c -m]
And I don't know the reason why.

Oh btw, what does the "list" means in this code?

Code: Select all

utimer 15 [list unset netsplit_lock($c)]
+ Stealth Box +
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

There could be a few more seconds added before the -m is sent due to the internal delay to prevent flooding. Removing the brackets ([]) will not change this. How long did it take to mode the channel -m?

list makes a list :P (which is what utimer expects - passing it a string like you do now is not a good idea)
Have you ever read "The Manual"?
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

How long did it take to mode the channel -m?
It's depends. Sometime the bot would take up to 15 secs (one or two time) and majority it only took 1-3 secs and the bot would -m to the channel. Just like this -
::20:22:31:: <@Bot> Netsplit detected, channel set to +m for 15 secs.
::20:22:32:: * Bot sets mode: +m
::20:22:35:: * Bot sets mode: -m
Although I've set the timer to 15secs.
+ Stealth Box +
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Stealthx wrote:
::20:22:31:: <@Bot> Netsplit detected, channel set to +m for 15 secs.
::20:22:32:: * Bot sets mode: +m
::20:22:35:: * Bot sets mode: -m
Although I've set the timer to 15secs.
When did the split occur? Do you have any other scripts sending stuff to the server on splits? Is your bot in many channels that are moded +m by this script? Try adding a flushmode after the first pushmode

Code: Select all

pushmode $c +m
flushmode $c
Have you ever read "The Manual"?
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

When did the split occur?
What do you mean by "when"?

Nope, I do not have any other TCL which send stuff to the server on splits. My bot is only on 3 channels (opped).
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Try delaying the timer interval say, to 30 secs or more and then check
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Stealthx
Halfop
Posts: 68
Joined: Fri Oct 01, 2004 3:37 am
Location: StealthBox

Post by Stealthx »

awyeah wrote:Try delaying the timer interval say, to 30 secs or more and then check
Right now, my coding is...

Code: Select all

bind splt - * netsplit:lock 
proc netsplit:lock {n u h c {r " "}} { 
global netsplit_lock 
if {![info exists netsplit_lock($c)]} { 
if {![string match *m* [scan [getchanmode $c] %s]]} { 
pushmode $c +m 
puthelp "PRIVMSG $c :Netsplit detected, channel will be set to moderated for 30 seconds." 
utimer 30 [list pushmode $c -m] 
} 
set netsplit_lock($c) "#abc" 
utimer 30 [list unset netsplit_lock($c)] 
} 
}
But doesn't work, the bot doesn't set +m to the channel anymore and I see no error in the TCL. What's wrong? :(
+ Stealth Box +
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I'm using the locking system on my bot with another script and it works fine for me, plus it is proving to be very effective especially for channel notice and long text floods. So much effective that I've removed sentinel.tcl from my bot as it made the bot alot slower, and replaced it by adding a clone kicker detecting fast joins. I modified the lock timer to be removed after 10secs and it works fine for me.

Here are my settings, if we replace them into this script:

Code: Select all

bind splt - * netsplit:lock
 proc netsplit:lock {n u h c {r ""}} {
  global netsplit_lock
  if {![info exists netsplit_lock($c)]} {
  if {[botisop $c] && ![string match *m* [getchanmode $c]]} {
   putquick "MODE $c +m" -next; utimer 10 [list remove:lock $c]
   putquick "PRIVMSG $c :Netsplit detected - Channel has been locked to +m for 10 secs." -next
  }
  set netsplit_locked($c) "+m.already.locked"
  utimer 15 [list unset netsplit_lock($c)]
 }; return 0
}

proc remove:lock {c} {
 if {[string match *m* [getchanmode $c]] && [botisop $c]} {
  putquick "MODE $c -m" -next; return
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

user's code way way too simple, you have complicated it too much for a few changes... :o
Once the game is over, the king and the pawn go back in the same box.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

There is nothing complicated between his code and my code. Didn't modify anything in the original procedure, just added an extra proc, so the bot doesn't remove un-necessary modes, i.e. it doesn't remove modes which aren't set in the channel.

That is because when floods happen other people also set modes, and remove modes and I've seen on alot of channels causes a mode flood, so if other people do mode floods, we don't want the bot to do it atleast.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked