Congrats on posting your first snippet. The only thing I can say is the if ($nick==$nick) statement is really not necessary. It will always return true. If you are going to build further on this snippet, you may want to consider what happens if alot of users join at once or a server reset. You might flood out.
Unfortunately, colored buttons have to be drawn using bitmap images in DCX. You can either specify a button bitmap or just use an image control. The windows API allows you to change the background color of a button object, but DCX does not support the property of BackColor yet, as far as i know.
Looking at the documentation, I have never messed with hgradient or vgradient. I do not know how to use them.
On the note of reducing code, if using v6.35 or higher, you can use:
$regsubex($str(.,4),/./g,$r(a,z) $+ $r(A,Z))
rather than
$rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z)
to trim a bit
Flood control can be done several ways.. basically you halt the alias if the command has been used too many times within too many seconds..
my code is basic and I am certain that others have much more effective code that handles per channel and is shorter.
Basic Example:
;allows 3 commands per every 2 seconds, change numbers as you wish
on *:TEXT:Lol:#:{
;increments (adds +1) a flood variable that resets after 2 seconds
inc -u2 %lol.flood
;if the flood variable has not incremented 3 or more
if (%lol.flood <= 3) {
msg # $nick We are all laughing at you! not with you! I mean.. With you.. -AhemAhem-
}
}
I think the first if statement should be && and not ||. If user is op AND you are op, versus If user is op OR you are op.. otherwise it still tries to work if you are not op.
There are a few other things beyond what napa and jethro are suggesting (which are very valid), but not relevant to functionality.
Ask away if you need help adding what they suggested. Keep up the work!
I just noticed how the number of thoughts changes from page to page.
44,000 was just the initial number. The socket updates the rt.idx which is the $r value after the socket runs once. But you are right Jethro, I am grabbing the wrong number. I will update to set the initial $r to 40,000 and have the sockread fetch the number of thoughts and not the number of comments.