mIRC Home    About    Download    Register    News    Help

Print Thread
Help with Sockets #169416 22/01/07 10:50 PM
Joined: Dec 2002
Posts: 22
S
Synister Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 22
Here is the code.
Code:

dialog fuelradioreq {
  title "MaxOctane Radio Requester"
  size -1 -1 149 80
  option dbu
  button "Close", 1, 114 66 34 12, default cancel
  text "Enter Artist and Song Name Below", 2, 24 1 86 8
  text "Artist: ", 3, 4 14 15 8
  edit "", 4, 32 13 71 10, autohs
  text "Song Title:", 5, 3 25 26 8
  edit "", 6, 32 24 71 10, autohs
  button "Send Request", 7, 106 16 40 12
  edit "", 8, 1 43 147 21, read multi return autohs autovs
  text "Status Window", 9, 44 35 52 8
}

on *:dialog:fuelradioreq:init:0: {
  did -a fuelradioreq 4 %fnreq.artist
  did -a fuelradioreq 6 %fnreq.song
}
on *:dialog:fuelradioreq:sclick:7: { 
  set %fnreq.artist $did(fuelradioreq,4).text
  set %fnreq.song $did(fuelradioreq,6).text
  songreq
}








;;Request Sockets


on *:SOCKOPEN:SongReq:{   
  sockwrite -n $sockname NICK FN-RadioReq   
  sockwrite -n $sockname USER $&    
    $+(",FN-RadioReq),") $&    
    $+(",$gettok($emailaddr,2,64),") $&    
    $+(",%SongRequest.server,") $&    
    $+(:,$fullname)  
  fnreq_conn * Song Request: connected
}

on *:SOCKCLOSE:SongReq:{   
  fnreq_term * Song Request: terminated by the server  
  SongRequest.Retry
}


alias SongRequest.Retry { 
  inc %SongRequest.retries   
  if (%SongRequest.retries <= SongRequest.maxretries) .timer 1 10 sockopen $sockname %SockRequest.server 6667   
  fnreq_retry * Song Request: All ( $+ %SongRequest.maxretries $+ ) retries failed, Cant send request.  
  halt
}



on *:SOCKREAD:SongReq:{    
  if ($sockerr > 0) {       
    fnreq_retry1 * Song Request: $+([,$sock($sockname).wserr,]) $sock($sockname).wsmsg    
    SongRequest.Retry  
  }   
  var %1-    
  sockread %1-  
  while ($sockbr > 0) {       
    tokenize 32 %1-       
    if (PING == $1) sockwrite -n $sockname PONG $remove($2,:)       
    elseif ($4 == :VERSION) {      sockwrite -n $sockname NOTICE $right($gettok($1,1,33),-1) :VERSION MaxOctane.net Radio Requester    
    }    
    elseif ($2 == 433) {           
      if ($4 == $mnick) sockwrite -n $sockname NICK FN-RadioReq1           
      elseif ($4 == FN-RadioReq1) sockwrite -n $sockname NICK FN-RadioReq2           
      else {       
        fnreq_full * Song Request: Requests are Full, Please try again.               
        sockclose $sockname               
        halt      
      }    
    }   
    elseif ($2 == 376) {      
      sockwrite -n $sockname PRIVMSG syn-test :!awayrequest 4 $mnick from $server -- Requests - 7 Artist/Song : %SongRequest.song       
      fnreq_sent * Song request sent: %SongRequest.song           
      unset %SongRequest.*
      unset %fnreq.*    
      sockclose $sockname
      fnreq_done * Song Request: Request Sent -- DONE
      halt    
    }    
    sockread %1-  
  }
}

alias SongReq {  
  if (%fnreq.artist == $null) {      
    fnreq_art * Song Request: No Artist Requested -- Enter Artist Name   
    halt 
  } 
  if (%fnreq.song == $null) {      
    fnreq_song * Song Request: No Song Requested -- Enter Song Name   
    halt 
  }   
  set -u600 %SongRequest.server irc.maxoctane.net  
  set -u600 %SongRequest.maxretries 5  
  set -u600 %SongRequest.song %fnreq.artist - %fnreq.song 
  sockopen SongReq %SongRequest.server 6667
}
alias -l fnreq_art did -ra fuelradioreq 8 $1-
alias -l fnreq_song did -ra fuelradioreq 8 $1-
alias -l fnreq_conn did -ra fuelradioreq 8 $1-
alias -l fnreq_sent did -ra fuelradioreq 8 $1-
alias -l fnreq_full did -ra fuelradioreq 8 $1-
alias -l fnreq_term did -ra fuelradioreq 8 $1-
alias -l fnreq_retry did -ra fuelradioreq 8 $1-
alias -l fnreq_retry1 did -ra fuelradioreq 8 $1-
alias -l fnreq_done did -ra fuelradioreq 8 $1-


This is what Im trying to do.
Connect to a Server using a Selected nick the script uses (FNRadio-Req) and msg a user a shoutcast request.

It connects just fine to the server. But never msgs the nick and just hangs. can someone help me out with this.




Re: Help with Sockets [Re: Synister] #169422 22/01/07 11:29 PM
Joined: Dec 2002
Posts: 22
S
Synister Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 22
Anyone who can help with this... It worked perfectly on a older version of mirc




Re: Help with Sockets *DELETED* [Re: Synister] #169495 23/01/07 11:24 PM
Joined: Dec 2002
Posts: 22
S
Synister Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 22
Post deleted by Synister




Re: Help with Sockets [Re: Synister] #169496 23/01/07 11:36 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Please do not bump posts. When someone knows the answer and has time to help you with it, they will. Remember that everyone here is a volunteer and most have other things (like jobs) that are more pressing than trying to answer every post within a short period of time.


Invision Support
#Invision on irc.irchighway.net
Re: Help with Sockets [Re: Riamus2] #169542 24/01/07 09:31 PM
Joined: Dec 2002
Posts: 22
S
Synister Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 22
thanks for any help.. I figured it out...