mIRC Home    About    Download    Register    News    Help

Print Thread
#49153 13/09/03 11:38 AM
D
djmadness
djmadness
D
I have a plan, but i have problems thinking over how to get this done....


A dialog for the clients, without opening a server sonnection, but with sockets, connects to an irc network and in a channel, as if they just was with the defauld mIRC, anybody, that has an idear for how ro get started ???

please respond

P
pheonix
pheonix
P
Code:
alias sockbot {
  hadd -m sockbot nick $2
  sockopen sockbot. [ $+ [ $hget(sockbot,nick) ] ] $1 $iif($3,$3,6667)
}
on *:sockopen:sockbot.*:{
  if ($sockerr) { return }
  echo -s Sockbot Connected!
  sockwrite -n $sockname nick $hget(sockbot,nick)
  sockwrite -n $sockname user sock . . sock
}
on *:sockread:sockbot.*:{
  if ($sockerr) { return }
  if ($1 == ping) { sockwrite -n $sockname PONG $remove($2,:) }
}
on *:sockclose:sockbot.*:{
  hfree sockbot
  echo -s Sockbot Disconnected!
}

/sockbot <server> <nickname> <port>
this should keep it connected smile.

D
djmadness
djmadness
D
yeah, bot how do they join a channel ???, and reseeve text, without needing a bot there ???

nice work there smile

Joined: Dec 2002
Posts: 397
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
im kinda interested in this script now beacuse i have ideas that could make my script better i just need to figur out how can i make it so after it gets the first ping pong to join the channel #matrixnet and as its in their echo messages to a dialog or and @window...... any one help plz? confused

D
djmadness
djmadness
D
thats my plan aswell, but a dialog would be better...
Does anybody have a idear on how to get this to work ??


P
pheonix
pheonix
P
if you use that script the commands are kind of the same as usual:
/sockwrite -n sockbot.* JOIN <#channel>
/sockwrite -n sockbot.* PART <#channel>
/sockwrite -n sockbot.* PRIVMSG <#channel> <message>
/sockwrite -n sockbot.* NICK <nick>
/sockwrite -n sockbot.* QUIT <message>
etc
to get the joins/parts etc:
on *:sockread:sockbot.*:{
sockread %s
tokenize 32 %s
if ($sockerr) { return }
if ($1 == ping) {
sockwrite -n $sockname PONG $remove($2,:)
}
echo -s $1-
}
that will echo what the socket reads, but you have to do the parsing yourself.

D
djmadness
djmadness
D
Thank you very much, i have the full idear now smile thx


D
djmadness
djmadness
D
just 1 question, how would it resive text from the channel ??

D
djmadness
djmadness
D
and how would i reseve text from a channel ???
and how will i know who is on channel ??

.... ?¿ <<-- me right now

P
pheonix
pheonix
P
when you join a channel you get a /names reply to the socket, you can get the nicknames from there, you can either create a fairly big sockbot and make it so u can use it on its own, or make a small one where its only useable in the same channel as you.
use the echo -s $1- to figure out text, on very few servers its different to most..


Link Copied to Clipboard