|
|
Joined: Jan 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
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
|
|
|
|
Joined: Jan 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jan 2003
Posts: 10 |
I did something really simple so far: 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.
|
|
|
|
Joined: Jan 2003
Posts: 237
Fjord artisan
|
Fjord artisan
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 }
|
|
|
|
Joined: Jan 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
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.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: Jan 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
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? 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 < $+ $me $+ > $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
|
|
|
|
Joined: Jan 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Jan 2003
Posts: 10 |
Please? Any Help? I really want to know how to do this. Please try to help me.
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
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
|
|
|
|
|
|