Hello I'm working on a connection
But it seems that When I add a who or flood protection it disconnects but without these it holds well any idea's?
Thanks ![]()
A TG007 community discussion started by Dippy.
Hello I'm working on a connection
But it seems that When I add a who or flood protection it disconnects but without these it holds well any idea's?
Thanks ![]()
will need to see some kinda coding on what kinda flood control you have
Well I throught I post the code
alias localwrite sockwrite -tn sock.local $1-
on *:start:sconnect
alias sconnect {
if ($sock(sock.local)) sockclose sock.*
var %p $r(1000,9999)
while (!$portfree(%p)) var %p $r(1000,9999)
socklisten init.connection %p
server localhost %p
}
on *:sockclose:sock.server:{
echo -a 4* Server disconnected. Retrying.
sockclose sock.local
sconnect
}
on *:socklisten:init.connection:{
sockaccept sock.local
sockclose $sockname
sockopen sock.server 24.215.5.3 6667
}
on *:sockclose:sock.server:{
echo -a 4* Server disconnected. Retrying.
sockclose sock.local
sconnect
}
on *:sockread:sock.local:{
var %r | sockread %r | tokenize 32 %r
if ($1 = NICK) || ($1 = USER) halt
elseif ($2-) .sockwrite -n sock.server $1-
return
}
on *:sockopen:sock.server:{
if ($sockerr) { sockclose sock.local | .timer 1 5 sconnect | halt }
var %pass = %password, %l
if ($len(%pass) != 32) %pass = $md5(%pass)
sockwrite -n $sockname AUTHTYPE IRCWX1
sockwrite -n $sockname LOGINH %Email %pass
sockwrite -tn $sockname USER $me $me $me :BLUE CONNECTION VERSON 1.0
sockwrite -n $sockname CLIENTMODE cd2
}
on *:sockread:sock.server:{
var %r | sockread %r | tokenize 32 %r
if ($window(@debug)) echo @debug $+(,$sockname,: $1-)
if ($1 == PING) .sockwrite -n $sockname PONG $2-
if ($raw == 401) { .echo -s $color(info2) $+(Error,$clr($raw),:) No such nick $clr($2) | halt }
if ($raw == 403) { .echo -s $color(info2) $+(Error,$clr($raw),:) No such channel $clr($2) | halt }
if ($raw == 404) { .echo -s $color(info) $+(Error,$clr($raw),:) You cant talk in $2 | halt }
if ($raw == 412) { .echo $2 $color(info) $+(Error,$clr($raw),:) $2- | halt }
if ($raw == 421) { .echo -s $color(info2) $+(Error,$clr($raw),:) Unknown Command $clr($2) | halt }
if ($raw == 432) { .echo -s $color(info2) $+(Error,$clr($raw),:) Bad nick | halt }
if ($raw == 433) { .echo # $color(info2) $+(Error,$clr($raw),:) Nick in use | halt }
if ($raw == 442) { .echo -s $color(info2) $+(Error,$clr($raw),:) Your not on that channel | halt }
if ($raw == 485) { .echo $2 $color(info2) $+(Error,$clr($raw),:) You are not a channel owner. | halt }
if ($raw == 482) { .echo $2 $color(info2) $+(Error,$clr($raw),:) You are not op in this channel. | halt }
if ($raw == 510) { .echo -a $color(info) $+(Error,$clr($raw),:) $2- | halt }
if ($raw == 471) { .echo -s $color(info2) -> Knock: Cannot join $2 $clr(Room is Full) | halt }
if ($raw == 473) { .echo -s $color(info2) -> Knock: Cannot join $2 $clr(Invite Only) | halt }
if ($raw == 474) { .echo -s $color(info2) -> Knock: Cannot join $2 $clr(Ban) | halt }
if ($raw == 475) { .echo -s $color(info2) -> Knock: Cannot join $2 $clr(Need Key) | halt }
if ($2 == 353) { $remove($4-,=,:) }
if ($raw == 366) { haltdef }
if ($raw == 002) { haltdef }
if ($raw == 003) { haltdef }
if ($raw == 005) { haltdef }
if ($raw == 251) { haltdef }
if ($raw == 265) { haltdef }
if ($raw == 315) { haltdef }
if ($raw == 801) { haltdef }
if ($raw == 802) { haltdef }
if ($raw == 803) { haltdef }
if ($raw == 820) { haltdef }
if ($raw == 915) { haltdef }
if ($raw == 903) { haltdef }
if ($raw == 908) { haltdef }
if ($raw == 914) { haltdef }
if ($raw == 908) { echo 4 -t $active No permission to perform command | haltdef }
if ($raw == 914) { haltdef }
if ($2 == 818) { echo 4 -a * $mid($remove($1-,818,FlashIrcServer.1,$me,$chr(35),$chr(37),$chr(58),,)$1-,12,60) | halt }
elseif ($2 == PRIVMSG) {
var %msg = $gettok($gettok($remove($4-,[br]),2-,93),$calc($numtok($gettok($remove($4-,[br]),2-,93),91)-1),91)
if ($numtok($4-,91) < 2) { %msg = $gettok($1-,2-,58) }
elseif ($numtok($4-,91) >= 2) { %msg = $findtext($right($4-, -1)) }
if (!%msg) { %msg = $3- }
.sockwrite -n sock.local $chr(58) $+ $replace($right($gettok($1,1,33),-1),>,Guest_) $+ ! $+ $gettok($1,2,33) $2-3 $+(:, $+ %msg)
}
else sockwrite -n sock.local $1-
}
raw 352:*: { if (G isin $7) && ($me ison $2) { cline -l $color(Blue) $2 $6 } }
raw 366:*: {
var %chan = $2 | if ($eval(% $+ WhoChan. $+ %chan,2)) { .unset $eval(% $+ WhoChan. $+ %chan,1) | var %i = 1, %nick
while ($nick(%chan,%i)) { %nick = $v1 | if (%nick != $me) { who %nick } | inc %i }
}
}
alias findtext {
var %in, %out, %a, %b, %c, %d, %f, %g, %l
%in = $remove($replace($1-,$chr(32),$chr(160)),$chr(91) $+ /style $+ $chr(93),$chr(91) $+ br) $+ ]
%a = 1
%b = $numtok(%in,91)
%c = $numtok(%in,93)
:top
inc %a
if (%a > %c) { %out = $replace(%d,$chr(160),$chr(32)) | return %out }
%out = $gettok(%in,%a,93)
if (style !isin $gettok(%out,1,91)) %d = %d $+ $gettok(%out,1,91)
goto top
}
Why do you have two instances of an on sockclose event? They look like they're doing the same thing.
Why do you have two instances of an on sockclose event? They look like they're doing the same thing.
Where?
Here
on *:sockclose:sock.server:{
echo -a 4* Server disconnected. Retrying.
sockclose sock.local
sconnect
}
on *:socklisten:init.connection:{
sockaccept sock.local
sockclose $sockname
sockopen sock.server 24.215.5.3 6667
}
on *:sockclose:sock.server:{
echo -a 4* Server disconnected. Retrying.
sockclose sock.local
sconnect
}
Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)
He probably inadvertently placed it there... ![]()
ok Thanks For that
My Second Question How would you go about adding a counter?
Thanks ![]()
A counter? Be more specific.
i think he means a timer so that its not all goiong off at once like TGK advised
Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)
Ahhh ok Timer I know ![]()
![]()
Thanks
Well.
I see there's another [kind gentleman] here trying to rip my shit.
Golly gosh, it's not even worth ripping
If you want to use my connection, at least ask.
But thanks, Dippy, for the compliment of the rip.
Anyone want proof of my ripping accusation, feel free to look at the original connection, at the following: Simple Dodgy Connection.
[Edited so it doesn't offend err0r's delicate sensibilities. ;p]
Lol burn
The scripting world is so dumb... which is sort of why I quit... Everyone accuses left and right of everyone ripping their code. -- it gets old very fast.
err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky
I don't accuse willy nilly, but there is no way in the world that this isn't ripping - he's blatantly copied & pasted large sections of code. If people rip elegantly, and make the code their own, I don't mind. Copy & pasting is a no-no, especially when the person in question doesn't understand the code. (As evidenced by the fact that he's asking for help with it.)
Josh, it is what you make of it. Don't be hampered by what others do if you dont like it. Just because other's attitude may get you down doesn;t mean you should stop. It means you should continue and show others the qualities you appreciate.
Nah, that's ok... mIRC has gotten old... There's not much you can do in it that hasn't been done before... I'm going to stick to drawing, digital painting, and 3d animation. ![]()
err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky
Sign in to reply or start a new topic where your account has permission.