sockets - Add a pause before further execution in mIRC -


so i've been thinking on hour did not arrive conclusion script. trying add "status check" 3 irc servers via mirc sockets. problem i'm facing execution jumps on next step without socket connection being completed hence returns false value i.e offline.

i tried using timer before goto commands returns ' not found'

code:

on *:text:!stats:#: {   sockopen ircaurora aurora.irchound.tk 6667   sockopen irckepler kepler.irchound.tk 6667   sockopen ircjupiter jupiter.irchound.tk 6667    sockpause ircaurora   sockpause irckepler   sockpause ircjupiter    :true   msg $chan ----status----   goto check1   halt    :check1   if ($sock(ircaurora,pause) == 1) {     msg $chan 1aurora -  9online   }   else {     msg $chan 1aurora -  4offline    }   goto check2   halt    :check2   if ($sock(ircjupiter,pause) == 1) {     msg $chan 1jupiter -  9online    }    else {     msg $chan 1jupiter -  4offline   }    goto check3   halt    :check3   if ($sock(irckepler,pause) == 1) {     msg $chan 1kepler -  9online   }   else {     msg $chan 1kepler -  4offline    }   halt } 

i know 1 solution set php bot, want on mirc.

any appreciated. in advance.

never mind .. i've found solution problem. simple needed add alias function (that replies if socket pause if true / false) timer.

solved code:

on *:text,loaddservers:#: {   if (%admin. [ $+ [ $nick ] ] = 1) {      msg $chan default servers being loaded.     set %server1 aurora.irchound.tk     set %server2 jupiter.irchound.tk     set %server3 kepler.irchound.tk   }   else {     msg $chan access denied.   } }  ;create socket connection servers on trigure.  on *:text:,status*:#: {   if ($2 = all) {     sockopen ircaurora %server1 6667     sockopen irckepler %server2 6667     sockopen ircjupiter %server3 6667     set %chan $chan     msg $chan connecting servers...     msg $chan >>>status of servers<<<     timer2 1 5 checkall   }   if ($2 = aurora) {     sockopen ircaurora %server1 6667     set %chan $chan     msg $chan connecting server $2 $+ ...     timeraurora 1 5 checkaurora   }   if ($2 = kepler) {     sockopen irckepler %server2 6667     set %chan $chan     msg $chan connecting server $2 $+ ...     timerkepler 1 5 checkkepler   }   if ($2 = jupiter) {     sockopen ircjupiter %server3 6667     set %chan $chan     msg $chan connecting server $2 $+ ...     timerjupiter 1 5 checkjupiter   } }  ;aliases each server status response.  alias checkaurora {   if ($sock(ircaurora,pause) == 1) {     msg %chan 1aurora -  9online   }   else {     msg %chan 1aurora -  4offline    }   halt }  alias checkjupiter {   if ($sock(ircjupiter,pause) == 1) {     msg %chan 1jupiter -  9online   }   else {     msg %chan 1jupiter -  4offline    }   halt }  alias checkkepler {   if ($sock(irckepler,pause) == 1) {     msg %chan 1kepler -  9online   }   else {     msg %chan 1kepler-  4offline    }   halt }  alias checkall {   if ($sock(ircaurora,pause) == 1) {     msg %chan 1aurora -  9online   }   else {     msg %chan 1aurora -  4offline    }   goto check2   halt    :check2   if ($sock(ircjupiter,pause) == 1) {     msg %chan 1jupiter -  9online    }    else {     msg %chan 1jupiter -  4offline   }    goto check3   halt    :check3   if ($sock(irckepler,pause) == 1) {     msg %chan 1kepler -  9online   }   else {     msg %chan 1kepler -  4offline    } } 

note: i've excluded part of script that's not related question.. may find undefined variables.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -