| View previous topic :: View next topic |
| Author |
Message |
CP1832 Halfop
Joined: 09 Oct 2014 Posts: 68
|
Posted: Thu Aug 16, 2018 2:40 pm Post subject: Help with blackmeteo |
|
|
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. |
|
| Back to top |
|
 |
Ezekiel Voice

Joined: 16 Dec 2014 Posts: 21
|
Posted: Tue Aug 21, 2018 4:17 am Post subject: |
|
|
| 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.. |
|
| Back to top |
|
 |
CP1832 Halfop
Joined: 09 Oct 2014 Posts: 68
|
Posted: Wed Aug 22, 2018 6:22 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Ezekiel Voice

Joined: 16 Dec 2014 Posts: 21
|
Posted: Thu Aug 23, 2018 12:56 am Post subject: |
|
|
| why not try and contact the author of the script? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Aug 23, 2018 1:45 am Post subject: |
|
|
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: |
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.
PS: @BLaCkShaDoW
| Code: |
set number [scan $meteo(flood_prot) %\[^:\]]
set timer [scan $meteo(flood_prot) %*\[^:\]:%s]
|
really? Here's a cleaner version:
| Code: |
scan $meteo(flood_prot) {%d:%d} number timer
|
and from here you can take things one step further like:
| Code: |
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: |
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. |
|
| Back to top |
|
 |
CP1832 Halfop
Joined: 09 Oct 2014 Posts: 68
|
Posted: Thu Aug 23, 2018 4:21 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|