mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
;/sb_open [ip] [port]
alias sb_open {
if ($socket(sb)) {
echo -a socket already open!
return
}
if ($1 == $null) {
echo -a you must enter a ip!
return
}
if ($2 == $null) {
echo -a you must enter a port!
return
}
sockopen sb $$1 $$2
echo -a socket open!
return
}
alias sb_close {
if ($socket(sb)) {
sockclose sb
echo -a socket closed!
return
}
else {
echo socket not open!
return
}
}

it always returns socket not open!, whats wrong?



;Check for Life

if (%life == $null) {
goto getlife
}
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Socket Identifiers

$sock(name,N)
This returns information about a socket connection that you created using the socket commands.

if ($sock(sb)) {

Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
so how would i see if the socket is open, and if it is close it, and if its not, echo sb not open?



;Check for Life

if (%life == $null) {
goto getlife
}
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
As Nimue said, you're using $socket() instead of $sock().


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
oooo, gotcha smile



;Check for Life

if (%life == $null) {
goto getlife
}

Link Copied to Clipboard