mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 21
I
Iljan Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Mar 2005
Posts: 21
The script underhere does not work, i tryed to change my nick in another and then the script should react by posting it in to a webpage... But it gives the following error msg:

[03:43:29] -> Server: nick DeVeste08
-
( Unknown command
-
[03:43:29] * Your nick is now DeVeste08
-
* /sockwrite: 'devesteservnick' not connected (line 15, script.ini)

Code:
; --- Nick Update ---
on 1:NICK:{
  if ($nick == $me) {
    set %now.nick $me
    .sockopen devesteservnick joti.scoutingdeveste.nl 80
    .sockwrite -n devesteservnick GET /beheer/update.php?action=nickchange $+ &newnick= $+ %now.nick $+ &nick= $+ %http.nick HTTP/1.0 $+ $crlf
    .sockwrite -n devesteservnick Accept: */* $+ $crlf
    .sockwrite -n devesteservnick User-Agent: DeVeste Kinder mIRC $+ $crlf
    .sockwrite -n devesteservnick Host: joti.scoutingdeveste.nl $+ $crlf
    .sockwrite -n devesteservnick $crlf
    set %http.nick $me
    echo 4 -s Nickchange updating to server
  }
}

on *:SOCKCLOSE:devesteservnick:{ /echo 4 -s Http server updated, thank you }

; --- Part Channel ---

on 1:PART:{
  if ($nick == $me) {
    .sockwrite -n devesteservpart GET /beheer/update.php?action=part $+ &nick= $+ $me $+ &channel= $+ $chan HTTP/1.0 $+ $crlf
    .sockwrite -n devesteservpart Accept: */* $+ $crlf
    .sockwrite -n devesteservpart User-Agent: DeVeste Kinder mIRC $+ $crlf
    .sockwrite -n devesteservpart Host: joti.scoutingdeveste.nl $+ $crlf
    .sockwrite -n devesteservpart $crlf
    echo 4 -s Updating to server
  }
}

on *:SOCKCLOSE:devesteservpart:{ /echo 4 -s Http server updated, thank you }


; --- Join Channel ---

on 1:join:{
  if ($nick == $me) {
    .sockwrite -n devesteservjoin GET /beheer/update.php?action=join $+ &nick= $+ $me $+ &channel= $+ $chan HTTP/1.0 $+ $crlf
    .sockwrite -n devesteservjoin Accept: */* $+ $crlf
    .sockwrite -n devesteservjoin User-Agent: DeVeste Kinder mIRC $+ $crlf
    .sockwrite -n devesteservjoin Host: joti.scoutingdeveste.nl $+ $crlf
    .sockwrite -n devesteservjoin $crlf
    echo 4 -s Updating to server
  }
}
on *:SOCKCLOSE:devesteservjoin:{ /echo 4 -s Http server updated, thank you }


; --- On Kick ---

on 1:KICK:{
  if ($nick == $me) {
    .sockwrite -n devesteservkick GET /beheer/update.php?action=kick $+ &nick= $+ $me $+ &channel= $+ $chan $+ &reason $1- $+ &operator= $+ $nick HTTP/1.0 $+ $crlf
    .sockwrite -n devesteservkick Accept: */* $+ $crlf
    .sockwrite -n devesteservkick User-Agent: DeVeste Kinder mIRC $+ $crlf
    .sockwrite -n devesteservkick Host: joti.scoutingdeveste.nl $+ $crlf
    .sockwrite -n devesteservkick $crlf
    echo 4 -s Updating to server
  }
}
on *:SOCKCLOSE:devesteservkick:{ /echo 4 -s Http server updated, thank you }  


Script is not finisched yet i have to make a sockopen etc for the part, join and kick script allsow but if the nick script works i can do the rest myself... wink

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
many things are wrong here, just to start try this
Code:
on 1:NICK:{
  if ($nick == $me) {
    echo -a $nick $newnick $me 
  }
}


next thing is that you are opening a socket and not giving it time to finish connecting before you are trying to send a "GET" command. I think you want to send a "POST" here instead and it should be done in a "on 1:sockopen:" event, this gives the socket time to connect before you are sending commands.

Joined: Mar 2005
Posts: 21
I
Iljan Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Mar 2005
Posts: 21
Tnx, i have set some timers for it, and it works fine! Great job shocked


Link Copied to Clipboard