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.

Help with blackmeteo

Help for those learning Tcl or writing their own scripts.
Post Reply
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Help with blackmeteo

Post by CP1832 »

Hi guys:

Does anyone know how to decode Blackshadow's script? I am trying to make some changes on the code but I can't figure out what encoding was used for this script and how to decode it. I tried an hex decoder but the code is still ununderstable. Does anyone know which encoding is this?

Link to file.
User avatar
Ezekiel
Voice
Posts: 21
Joined: Tue Dec 16, 2014 8:05 am

Post by Ezekiel »

everything that needs to be changed is uncoded, so I do not see your need to decode that tcl, if the author released like that..
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Post by CP1832 »

Ezekiel wrote:everything that needs to be changed is uncoded, so I do not see your need to decode that tcl, if the author released like that..
I understand, but I wanted to add (as an example) my personal flooding control script, which checks flooding on every script on my eggdrop, and for that I must add a call to the process in the code.
User avatar
Ezekiel
Voice
Posts: 21
Joined: Tue Dec 16, 2014 8:05 am

Post by Ezekiel »

why not try and contact the author of the script?
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Why do some people still try to make their code unintelligible when with a few commands (actually is just one command with two different arguments) that anyone can easily find on a Google search (if uses the right *cough* info *cough*) can get the exact code with variables and all that?

Anyway... I looked at the code and I can confirm it has some sort of flood control mechanism inside:

Code: Select all

set flood_protect [blackmeteo:flood:prot $chan $host]
if {$flood_protect == "1"} {
	set get_seconds [blackmeteo:get:flood_time $host $chan]
	blackmeteo:say $nick $chan [list $get_seconds "6" $nick] 0
	return
}
The blackmeteo:flood:prot returns 1 if the user is listed, else the blackmeteo:get:flood_time (another anti-flood mechanism) kicks in. This returns a number of seconds that are then used to say something into the channel via blackmeteo:say function. It's too early morning for me to try to follow his logic. :roll:

PS: @BLaCkShaDoW

Code: Select all

set number [scan $meteo(flood_prot) %\[^:\]]
set timer [scan $meteo(flood_prot) %*\[^:\]:%s]
really? :roll: Here's a cleaner version:

Code: Select all

scan $meteo(flood_prot) {%d:%d} number timer
and from here you can take things one step further like:

Code: Select all

if {[scan $meteo(flood_prot) {%d:%d} number timer] != 2} {
	set number 4
	set timer 10
}
to enforce two default values in case user input something wrong, like instead of a number put a letter or whatever.

Other two ways to get the two numbers out of meteo(flood_prot) variable:

Code: Select all

foreach {number timer} [split $meteo(flood_prot) :] { break }
lassign [split $meteo(flood_prot) :] number timer
Once the game is over, the king and the pawn go back in the same box.
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Post by CP1832 »

I'm aware that the code has a flood control mechanism, I just wanna add my bot's flood control mechanism, which takes into account every script on the bot. But in order to do that, I must call the script I use from within each script.
Post Reply