mIRC Home    About    Download    Register    News    Help

Print Thread
#8353 26/01/03 01:07 AM
Joined: Jan 2003
Posts: 10
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Jan 2003
Posts: 10
Well, I want to know how to make a window that has the same capabilities as a DCC chat or pm. Can anyone create one for me? Would menu @windowsname { commands work? Well please teach me some stuff about this, im very curious. Late


[irc://irc.mircx.com:6667/] - #Scripts, #Gmforum.cjb.net
#8354 26/01/03 01:17 AM
Joined: Jan 2003
Posts: 10
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Jan 2003
Posts: 10
I did something really simple so far:
Code:
  alias testwindow {
  window -e @test
}
menu @test {
  Echo
  .Echo://echo @test $$?="What do you want to echo?"
}
on 1:INPUT:@test: msg @test < $+ $nick $+ > $1- 

All i want now is to know how to connect to someone else. Thanks in advance.


[irc://irc.mircx.com:6667/] - #Scripts, #Gmforum.cjb.net
#8355 26/01/03 02:11 AM
Joined: Jan 2003
Posts: 237
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
the only way for them to talk to you, would be for them to like:

/msg <yournick> customchat <message>

You could intercept that, and make it echo into your custom window, but why? it would be a big hassle. There would be no way for them to reall interact with your custom window.



;Check for Life

if (%life == $null) {
goto getlife
}
#8356 26/01/03 02:29 AM
Joined: Jan 2003
Posts: 10
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Jan 2003
Posts: 10
Well, I do believe there is another way besides typing a /msg $nick command. The reason i'd like to do this is because with the proper coding, it could be faster than PM or DCC chats.


[irc://irc.mircx.com:6667/] - #Scripts, #Gmforum.cjb.net
#8357 26/01/03 04:13 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Well you could use sockets. Simply have both clients listening for connections on a port, when one client connects to another they could then use the socket to communicate. /help Sockets

#8358 26/01/03 05:33 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
PM = message transmitted by server from one user to another.
DCC = direct client connection. the fastest way... fast as scripted socket connection.

#8359 26/01/03 08:42 PM
Joined: Jan 2003
Posts: 10
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Jan 2003
Posts: 10
This is what i've done so far, using sockets, but I think everything works except reading the sent text. Help?
Code:
 alias testwindow {
  window -eds @test
}
menu @test {
  Set 
  .Set To Listen: socklisten -d $ip ts 8000
  .Set To Connect: //set %ts.ip $$?="What is the ip?" | sockopen ts %ts.ip 8000
}
on 1:INPUT:@test: //set %ts.txt &lt; $+ $me $+ &gt; $1- | sockwrite -b ts %ts.txt | aline %ts.txt
on 1:socklisten:ts: sockaccept tss
on 1:sockread:ts: //set %ts.rd $sockread | /aline @test %ts.rd 


[irc://irc.mircx.com:6667/] - #Scripts, #Gmforum.cjb.net
#8360 26/01/03 09:10 PM
Joined: Jan 2003
Posts: 10
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Jan 2003
Posts: 10
Please? Any Help? I really want to know how to do this. Please try to help me. confused


[irc://irc.mircx.com:6667/] - #Scripts, #Gmforum.cjb.net
#8361 27/01/03 04:22 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Are you trying to rescript DCC Chat? If you are, then you have to follow the protocol. If you're not, you can make up your own protocol.

You have /sockaccept tss but your sockread references ts, as does your on INPUT's /sockwrite.

You are also specifying the -d switch to bind to an IP; this switch is used if you have more than one IP connected to the internet so you most likely don't need it.

You use the -b switch for /sockwrite, indicating that you want to specify how many bytes you want to send, but you have not specified the number of bytes you wish to send after the socket name. This is used when you are sending binary data. The switch you want for sending straight text is -n to append a $crlf when the socket sends the data.

And finally, be aware that if you are writing your own protocol, both clients that are going to communicate must be using a script written to your new protocol. Just because you are using a protocol does not mean that anyone else is.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard