mIRC Home    About    Download    Register    News    Help

Print Thread
#155814 09/08/06 05:39 PM
Joined: Aug 2006
Posts: 21
X
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Hi!

(first sorry for my bad english)

I admin of a irc chanel and need a script to say "hello.." for users,friends,etc..)

And well i never programed in script frown i make this reading forums, tutorials,etc...

Code:
on 1:join:#: {

  if ($read(users.txt,w, $nick )) { /msg $nick Welcome!!
  }
}
 


Well with this all the people join and stay in users.txt the bot say "welcome". But well if join too many people the irc, etc.. generate a big lag, disconect, etc... and need send a message between 20s in 20s.

And well i have this (yes i know the code is wrong)

Code:
on 1:join:#: {

  if ($read(users.txt,w, $nick )) { write ONusers.txt $nick | /timer 1 20 /msg $read(ONusers.txt,w , $nick ) Welcome!!... | /timer 1 20 
  }
}


Why copy the join users in "Onusers.txt" ? well if 2 people join at the same time, and the bot send a message to the first and wait 20s... the other person no recive this message, for this i put the users entry in ONusers.txt (i have this now) and now need a code for the bot send a message in 20s to each people are in ONusers.txt

ex:

Enter john
Enter david
Enter sara
message send to john : Welcome!!....
20s after
message send to david : Welcome!!....
20s after
message send tosara : Welcome!!....
end

Sorry if i not explain well frown

Last edited by xaxoxaxin; 09/08/06 05:39 PM.
#155815 09/08/06 06:24 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You could just do it like this

Code:
 on !*:join:#: if ( $read(users.txt,nw,$nick) ) .timer 1 20 .msg $nick Welcome!!... 


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#155816 09/08/06 06:33 PM
Joined: Aug 2006
Posts: 21
X
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
After 20s the mesage is send to the 2 people at the same time:

Your code make this:

Enter john
Enter david
After 20s
Send mesage john Welome!!
Send mesage david Welome!!

And need make this:

Enter john
Enter david
Send mesage john Welome!!
After 20s
Send mesage david Welome!!

Last edited by xaxoxaxin; 09/08/06 06:37 PM.
#155817 09/08/06 08:30 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
This should be what you're looking for:

Code:
on *:JOIN:#: {
  if ($read(users.txt,nw,$nick)) {
    /greet_user $chan $nick
  }
}
alias greet_user {
  if ($1) {
    var %chan = $1, %nick = $2

    if (!$timer(greet_user)) .timergreet_user 1 20 /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 20 /msg %nick Welcome!! $chr(124) /greet_user
  }
}


-KingTomato
#155818 09/08/06 09:09 PM
Joined: Aug 2006
Posts: 21
X
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
KingTomato i love you XDDD

The code runs perfectly smile

And another thing i would make(sugestion for antoher people..)

Example the users are:

david
david21
JrDavid
.....

And i need put all the "davids" in the users.txt.... and the list will be more big if i make davids, johns etc...

If posible send the message to the people have a word in the name?

For example all the "users" will be for example "Kde_David" or "Newbie_john" etc...

And if enter 200 of people i need to put all the names in the user.txt etc.. but if posible this:

content of users.txt:
--------------------------------
Jr
Kde
newbie
Admin
Moderator
--------------------------------

And if the people enter in the irc how:

Jr_David
Admin_Xaxo
john_newbie
Sam_Kde_RPG

the bot say Welvome!!!

¿you understand me? only send this message to the people have any of the complete word listed in users.txt in any position

*name
name*
*name*

¿ is posible this?

Thanks in advance

#155819 10/08/06 09:46 PM
Joined: Aug 2006
Posts: 21
X
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Mmmm ¿impossible? are you trying kingtomato ¿?

And not is possible make an other form or anything ¿?...

#155820 12/08/06 06:37 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Try this:

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 20 /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 20 /msg %nick Welcome!! $chr(124) /greet_user
  }
}


Then, in your users.txt, make it look like:

Code:
Jr*
Admin*
*Newbie*


Or however you'd like to search for the names via wildcards.


-KingTomato
#155821 27/08/06 09:23 PM
Joined: Aug 2006
Posts: 21
X
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Aug 2006
Posts: 21
Hello,

I view now the code (i lost this page frown ....)

Well, i put your new code and runs perfectly kingtomato, very thanks smile

But the first code have a problem.

example of the problem:

(enter at the same time)
enter: john
enter: david
enter: xenxo
enter: Javi

And the program said hello to the only 2 first people. if enter 10 persons at the same time only said hello at the 2 first in enter.

I view the code and view "user 1" and "user 2" and i think you make enter 1 people, enter another.. wait 20s and said hello to the first perosn and wait 20s to the next people yes.. but if enter more than 2 persons at the same time only said "hello" to the first 2 persons (i don't know if you understand me...)

I make more proofs with other channels, with the previous code, with the next code etc... and not, only said hello to the 2 first people in entry.

Is the same problem in the first post. In the first post que problem is send a message to the first people but no at the second... with your code now, send a message to the first and the second person, but not to the third...

For solution this in the first post the idea is:

When entry a people save the name in a TXT:

on 1:join:#: {
if ($read(users.txt,w, $nick )) { write ONusers.txt $nick
}

}

And in the txt save the name with all the users (newbie,jr,Admin,etc..)

And after need and action to the program read of Onusers between for example 20s and send "welcome". And with this if entre 20people, the program save this 20 people in a txt and send "welcome" between 20s in each user. But well i don`t konw if is possible this.

Thanks in advance for all your help kingtomato.

#155822 30/08/06 06:01 PM
Joined: Aug 2006
Posts: 21
X
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!


Link Copied to Clipboard