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.

Idle time channel talk script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Idle time channel talk script

Post by m4s »

Hi all,

Can someone pls write a script which watches the idle time of the channel (configured in the script in min) and if this time passed the bot randomly chooses a sentence from a txt file and send it to the channel.
In this txt we might use actions as well (\001ACTION blalalabla).
The script should be on/off with a flag via DCC.

Thanks in advance!
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

You can have an eye on Reanimator made by MenzAgitat.

Explanations are in french, sorry.
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

CrazyCat wrote:You can have an eye on Reanimator made by MenzAgitat.
Explanations are in french, sorry.
Thank you CrazyCat, I tried the script but I got a strange error msg:

"[Reanimator - Error] The version of your Eggdrop is 1.8.4 1080404; Reanimator will only work correctly on Eggdrops version 1.6.20 or higher."

Translation is made by google translate. I don't speak French.
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

This is a weel known trouble, you can easily correct it :)
Find the line containing:

Code: Select all

if { [regsub -all {\.} [lindex $::version 0] ""] < 1620 }
Replace this previous code with:

Code: Select all

if { [package vcompare [regexp -inline {^[[:digit:]\.]+} $::version] 1.6.20] == -1 }
User avatar
Fahad
Op
Posts: 129
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

This script is in French Lang I guess. English not Available?
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

i can translate it will do it in a few :D i will give you a english version ;)
ComputerTech
User avatar
Fahad
Op
Posts: 129
Joined: Mon Aug 29, 2016 9:40 am

Post by Fahad »

ComputerTech wrote:i can translate it will do it in a few :D i will give you a english version ;)
Please Do :)
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

CrazyCat wrote:This is a weel known trouble, you can easily correct it :)
Find the line containing:

Code: Select all

if { [regsub -all {\.} [lindex $::version 0] ""] < 1620 }
Hello CrazyCat,

I cant find this line in my script. :roll:
I have v1.2 You can check it here:
https://pastebin.com/U9Gb9Nr2
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Line 97 you got this:

Code: Select all

if { [join [split [::tcl::string::range [lindex $version 0] 0 5] "."] ""] < 1620 } { putloglev o * "\00304\002\[Reanimator - Erreur\]\002\003 La version de votre Eggdrop est \00304\002$version\002\003; Reanimator ne fonctionnera correctement que sur les Eggdrops version 1.6.20 ou sup�rieure." ; return }
but it's different.

@CrazyCat Why don't you go with something simple like:

Code: Select all

if {[catch {package require "eggdrop 1.6.20"} err]} {
	# user doesn't have eggdrop 1.6.20 or whatever you want to set
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

Is this correct:

Code: Select all

if { [package vcompare [regexp -inline {^[[:digit:]\.]+} $::version] 1.6.20] == -1 }  {putloglev o * "\00304\002\[Reanimator - Error - Please upgrade your Eggdrop to 1.6.20 or above!" ; return } 
?
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I'm not the creator nor the maintainer of this script, but if I remember well, this way to check the eggdrop version is made to bypass a changement of version notation introduced in branch 1.8.
I'll try to find the conversation / explanation about that.
btw, the short code (made by the author of Reanimator) works well and is validated by himself (lol) and me (lol bis)
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

whoops i forgot to translate that script sorry will do it as soon as i can :D
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

wait a minute i just realised all you want is a anti idle script that says random messages from a txt file if nobody talks on a channel easy

http://tclarchive.org/download.php?id=1194

:D
ComputerTech
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

@CrazyCat It runs just fine on my eggdrop version 1.8.4 as you can see:

Code: Select all

.tcl package require eggdrop
Tcl: 1.8.4
.tcl catch {package require "eggdrop 1.6.20"} err
Tcl: 1
Once the game is over, the king and the pawn go back in the same box.
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I know that MenzAgitat had troubles with some versions having letters in the version. Can't remember which version it was, neither if it was eggdrop or windrop.
Post Reply