mIRC Home    About    Download    Register    News    Help

Print Thread
Disconnect and connect #157933 30/08/06 02:11 PM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Hello,

I view the problem in my previus script, and need an action to disconect and connect automatic.

For example, that my bot disconect and connect every 2min for example. I view another bots and view people disconnect and connect automatic but i not find the what is the code.

And if is possible, or disconect/connect every 2min o disconect/connect every 20 messages of "welcome's", i prefer this last one but well if not possible with time.

Thanks in advance!

Re: Disconnect and connect #157934 30/08/06 05:06 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You want your bot to disconnect then connect again, and do this every 2 mins?


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Re: Disconnect and connect #157935 30/08/06 06:15 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I think they want it to part the channel and hop back in, to get auto messages, possibly to kick/ban the messenger, not sure what the 20 is about

Re: Disconnect and connect #157936 30/08/06 06:24 PM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Well i have a problem, and when my bot sayd Welcome to about 36 persons +o- the irc appears an error.

the error says : "To much destinatios, wait 80s"

for exmple de proofs of max:

55
36
39
39
38
43
36
41
38
36

And well the bot need conect/discoencts about 2min 3 or 5min, and if is posssible the best will be disconnect/connect when send about 36 messages of "welcoms"

I asked for this error and the people not know what is the problem. And well the first solution i encountered is this disconnect/connect.

All with the last code in the previous post of KingTomato.

The last code of King tomato of the previus post + this, all this part of the code is finished smile . I only need to solution this.

And the bot only said "welcome" to the list of users.txt:
***********
*newbie
JR*
Admin*
**********

Last edited by xaxoxaxin; 30/08/06 06:27 PM.
Re: Disconnect and connect #157937 31/08/06 04:00 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
so the greeting is not in the channel it is a notice or msg?

and why does the bot greet everyone every 2 minutes? maybe the bot should only greet nicks that join, not when the bot joins, or change the script to msg the channel with a greeting, not each nick.

Re: Disconnect and connect #157938 31/08/06 11:17 AM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Aisss....

MikeChat isa msg no a notice.

And about 2 minutes, well or 5minutes i dont know. Simply i view if the bot is connected much time and send a msg to about 36 persons the irc blok the msgs and make error.

And for solution this, the best idea is when the bot send about 36 msg disconnect/connect.

A friend say are another form. WIth "Hop" but i not have idea about this command i looking in goggle for examples,etc..

for the moment the code is this(thanks to KingTomato):

Code:
 on *:JOIN:#: {
  var %file = users.txt, %line = $lines(%file)
  while (%line > 0) {
    var %string = $read(%file,n,%line)
    if (%string iswm $nick) /greet_user $chan $nick
    /dec %line
  }
}
alias greet_user {
  if ($1) {
    var %chan = $1, %nick = $2

    if (!$timer(greet_user)) .timergreet_user 1 0 /msg %nick Welcome!!  $chr(124) /greet_user
    else /set %greet.user $addtok(%greet.user,$+(%chan,:,%nick),32)
  }
  else if (%greet.user != $null) {
    var %next = $gettok(%greet.user,1,32), %chan = $gettok(%next,1,58), %nick = $gettok(%next,2,58)

    if ($gettok(%greet.user,2-,32)) /set %greet.user $v1
    else /unset %greet.user
    .timergreet_user 1 0 /msg %nick Welcome!! $chr(124) /greet_user
  }
 


And the users.txt for the moment have this:
*******************************************
Jr*
*NewBie
*Admin*
*******************************************

I dont know if the code have and error and the irc detect flood or anything.

MikeChat
Quote:
and why does the bot greet everyone every 2 minutes?

I don't want my bot disconnec/connect every 2 minutes, i want my bot is always online and say "welcome" to the people enter the channel.

But have a problem and when say "welcome" to more than 36 +o- persons an error ocurred. And for the moment the unique solution i have is this disconnect/connect when i view the error appears. But i need view in all moment the channel for disconnect/connect.

And for this i will make this code disconnect/connect for make the same i make to solution the error but in automatic.

But well if you find the error or another solution is welcome!!

Idea : Not is possible make a "message counter" and when send 36msg the bot disconnect/connect to the same channel ?(for example)

Re: Disconnect and connect #157939 31/08/06 06:38 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
let me make sure i understand what you want
when someone (not the bot) joins the channel, you want the bot to /notice the nick with a greeting
like:

on *:join:#channelname: notice $nick Hello! Welcome to our channel.

Re: Disconnect and connect #157940 31/08/06 06:47 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
to just cycle out and back in to channel

/timercycle 0 120 hop #channel 13B15e 13R15ight 13B15ack(cycling)


-or-

to disconnect from the server and rejoin

/timerdisco 0 120 server


something like that?


billythekid
Re: Disconnect and connect #157941 31/08/06 11:18 PM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Yes billythekid you understand me smile

/timercycle 0 120 hop #channel 13B15e 13R15ight 13B15ack(cycling)
This code not.....

-----------------------------------------------

/timerdisco 0 120 server
This code is ok, disconnect in 120s from the server and connect. But this only occured 1 time. I need this ocurred always:

Conect
wait 120s
disconect
connect
wait 120s
disconnect
.......




Code:
 
on *:JOIN:#: {
  var %file = users.txt, %line = $lines(%file)
  while (%line > 0) {
    var %string = $read(%file,n,%line)
    if (%string iswm $nick) /greet_user $chan $nick
    /dec %line
  }
}
alias greet_user {
  if ($1) {
    var %chan = $1, %nick = $2

    if (!$timer(greet_user)) .timergreet_user 1 0 /msg %nick Welcome!!! $chr(124) /greet_user
    else /set %greet.user $addtok(%greet.user,$+(%chan,:,%nick),32)
  }
  else if (%greet.user != $null) {
    var %next = $gettok(%greet.user,1,32), %chan = $gettok(%next,1,58), %nick = $gettok(%next,2,58)

    if ($gettok(%greet.user,2-,32)) /set %greet.user $v1
    else /unset %greet.user
    .timergreet_user 1 0 /msg %nick Welcome!!! $chr(124) /greet_user
  } 


And well now need 2 solutions:

1 the billythekid said : /timerdisco 0 120 server (but that this ocurred always and not one time)

And the second i prefer this:

When my bot send 40 messages /timerdisco 0 10 server.

¿is possible?

Re: Disconnect and connect #157942 31/08/06 11:49 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
To get the code from billythekid to work as you're wanting, you need to put the timer command into an on connect event
Code:
 on *:connect: .timerdisco 1 120 server  


Per your second request (aka your preference) change your greet_user alias to the following

Code:
 alias greet_user {
  if ($1) {
    var %chan = $1, %nick = $2
    if (!$timer(greet_user)) .timergreet_user 1 0 /msg %nick Welcome!!! $chr(124) greet_user
    else set %greet.user $addtok(%greet.user,$+(%chan,:,%nick),32)
  }
  elseif %greet.user {
    var %next = $gettok(%greet.user,1,32), %chan = $gettok(%next,1,58), %nick = $gettok(%next,2,58)
    if ($gettok(%greet.user,2-,32)) set %greet.user $v1
    else unset %greet.user
    inc %greet
    .timergreet_user 1 0 msg %nick Welcome!!! $chr(124) greet_user
    if %greet > 40 {
      unset %greet
      .timerdisco 1 10 server
    }
  } 
}
 


I noticed that you were missing a } in the alias, not sure if it's missing in your code, or if it got missed in a copy & paste.
The missing } has been put in place in the above code.

Re: Disconnect and connect #157943 01/09/06 11:01 AM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Not work frown

On put 40 i put 2 to proof, and not, send 4 messages and not disconnect frown .

I put 0,1,2 etc..... and not disconnect i change "><=" and nothing, i put /timerdisco for view and the command never is actived frown


*********************************
EDIT
*********************************

HEY, i think your codes work, but not when send 2msg, is when send 2msg at the same time the greet is up than 2. I think the code no count the msg send, count the msg send at the same time.

Or anything, only i view the timer is actived when i put " if %greet = 1 {" or "if %greet > 0 {"

And 2 people enter at the same time.

Last edited by xaxoxaxin; 01/09/06 12:48 PM.
Re: Disconnect and connect #157944 02/09/06 03:56 PM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Eis!

I enconter de error!!

In the code the "welcome" appears 2 times.

and this code:
if %greet > 30 {
unset %greet
/timer 2 0 /quit

Only is for the second Welcome. And the second welcome is rare say it, I think is this the error.

Only count the second wecolme ¿solution?

Re: Disconnect and connect #157945 02/09/06 06:17 PM
Joined: Aug 2006
Posts: 21
X
xaxoxaxin Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Well, i solve the problem smile

the : inc %greet

put in the first "welvome" and the else if > 40 also in the first. And the "inc %greet" out of this.

Thanks alot all your help!!!!

Byes!