Auto Join

By Cyber Lord on Feb 01, 2008

Paste in Remote

;==============================
;=======    Auto Joiner     ========
;==============================
;=======    by Cyber Lord   =======
;===============================
;=======   All Rights Reserved  ======
;===============================
;==========|| 2008 ||===========
;===============================

; Once loaded, type /ajoin to display the dialog

alias ajoin { dialog -m ajoin ajoin }
dialog ajoin {
  size -1 -1 150 105
  title "Auto Joiner - Cyber Lord"
  option dbu

  list 1, 5 5 70 100, sort
  button "Add", 2, 80 5 30 10
  button "Remove", 3, 115 5 30 10
  text "Channel", 6, 80 23 65 10
  edit "", 4, 80 30 65 10
  text "Set Key", 7, 80 43 65 10
  edit "", 5, 80 50 65 10
  button "Done", 10, 88 70 50 10, OK
}

on *:DIALOG:ajoin:init:0: {
  var %chan = 1, %key = 1
  while (%chan <= $numtok(%auto.join,44)) { did -a ajoin 1 $gettok(%auto.join,%chan,44) | inc %chan }
  while (%key <= $numtok(%auto.key,44)) { did -a ajoin 1 $gettok(%auto.key,%key,44) | inc %key }
}
on *:DIALOG:ajoin:sclick:2: { newchan }
on *:DIALOG:ajoin:sclick:3: {
  if ($did(1).sel == $null) return | var %line = $did(1).sel, %text = $did(1,%line) | did -d ajoin 1 $did(1).sel 
  if ($numtok(%text,32) == 2) %auto.key = $remtok(%auto.key,%text,1,44) | else %auto.join = $remtok(%auto.join,%text,1,44)
}
on *:DIALOG:ajoin:sclick:10: { if (($dialog(ajoin).focus == 4) || ($dialog(ajoin).focus == 5)) { newchan | halt } }
alias newchan {
  var %chan = $did(ajoin,4), %key | if (%chan == $null) return | if ($left(%chan,1) != $chr(35)) %chan = $chr(35) $+ %chan | if ($did(ajoin,5)) %key = %chan $did(ajoin,5) 
  if (%key) %auto.key = $addtok(%auto.key,%key,44) | else %auto.join = $addtok(%auto.join,%chan,44)
  did -a ajoin 1 $iif(%key,%key,%chan) | did -r ajoin 4,5 | did -f ajoin 4
}
on *:CONNECT: { .raw JOIN %auto.join  | var %temp = 1 | while (%temp <= $numtok(%auto.key,44)) { .raw JOIN $gettok(%auto.key,%temp,44) | inc %temp } }
Menu * {
  Auto Join
  .Set:/ajoin 

}

Comments

Sign in to comment.
virak   -  Mar 15, 2008

This code is very nice but in my country server do not allow to join immediatly, they put timer \"Please wait few seconds to join any channel.\" so how can i set a time? i mean when i connected, doest not join immediatly, it will delay 5ms then join to the #channel. can u tell me?

Thanks & Regards

More
 Respond  
Ivanalicius   -  Feb 07, 2008

Looked nice and Simple... But I think its better to delete this

.Set:/ajoin

and /join to set on Auto Join

Like this:

Menu * {
  Auto Join:/ajoin

}
More
 Respond  
Lindrian   -  Feb 07, 2008

Use /didtok. /help /didtok

More
 Respond  
Cyber Lord   -  Feb 07, 2008

Yep, but i coded my snippet hows Auto Join Manager

More
 Respond  
Tankgeneral   -  Feb 02, 2008

keep it simple like this:

on 1:CONNECT:{ /join #channel }

my oppinion

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.