Tchatting.com Forums
mIRC :: SCRIPTING & HELP mIRC Scripting help, General help, Tips and Tricks!

User Name
Password
Reply
 
Thread Tools Display Modes
  #1  
Old 21-02-2006, 11:37 AM
Cult's Avatar
Cult Cult est déconnecté
Registered User
 
Join Date: Jan 2005
Location: Lebanon
Posts: 2,124
Cult is a jewel in the roughCult is a jewel in the roughCult is a jewel in the rough
Send a message via MSN to Cult
auto join

First Command
-
/ajoin -a Network channel1 channel2 ...
-

This will add a channel or channels to auto-join on the specified network
Don`t care of inputting a channel twice.. It will overwrite it.
All channels must have the # prefix before them, Channels must be separated by spaces.

------

Second Command
-
/ajoin -r
-

This will delete a #channel from the autojoin list
One channel at a time can be deleted.

------

Third Command
-
/ajoin -c
-

this will clear all Auto-Join Channels on that specified network

------

Fourth Command
-
/ajoin -g
-

This will echo all auto-join channels in the specified network

------

Fifth Command
-
/ajoin -d
-

This will delete all the information for Auto-joining channels

------

Sixth Command
-
/ajoin on
-

it will activate the auto join snippet.

------

Seventh Command
-
/ajoin off
-

turn off the auto join snippet.

------

Eight Command
-
/ajoin
-

This will echo you if the snippet is enabled or disabled.

------

Nineth Command

-
/ajoin -Mg
-

It Stands for MASS get (Get everyting in Database)
No Parameters
This will make you get the list of all networks in the database
and all their auto-join channels


Code:
alias ajoin {
  if ($regex($1,/^-a$/i) == 1) {
    if ($regex($2,/[A-Z0-9]/i) == 0) { 
      !echo -a No Network specified 
      halt 
    }
    if ($regex($2,/[A-Z0-9]/i) == 1) {
      !.echo -q $regsub($2,,,%ane)
    }
    if ($regex($3-,/[A-Z0-9]/i) == 0) {
      !echo -a No Channels specified
      halt    
    }
    if ($regex($3-,/[A-Z0-9]/i) == 1) {
      var %spc = $calc($regex($3-,/\s/gi) + 1)
      if ($regex($3-,/[&%#]\S+/xig) != %spc) {
        !echo -a Channels must have one of $eval(#,0) prefix
        halt
      }
    }
    if ($regex($3-,/[&%#]\S+/xig) == %spc) {
      if ($numtok($hget(Ajoin,$2),32) == 0) {
        .hadd -m Ajoin $2 $3-
        .echo -q $regsub($3-,/\s/g,$chr(44),%lmnop)
        echo -a Added %lmnop to $2
        unset %lmnop
        halt
      }
      elseif ($numtok($hget(Ajoin,$2),32) > 0) { 
        var %xzs = 1
        var %chsjsh = $hget(Ajoin,$2)
        while (%xzs <= $numtok($hget(Ajoin,$2),32)) {
          .hadd -m Ajoin $2 %chsjsh $+ $chr(32) $+ $3-
          .hsave -o Ajoin Ajoin.dat 
          inc %xzs
          .echo -q $regsub($3-,/\s/g,$chr(44),%lmnop)
          echo -a Added %lmnop to $2
          unset %lmnop
          halt
        }
      }
    }
  }
  if ($regex($1,/^-c$/i) == 1) {
    if ($regex($2,/[A-Z0-9]/i) == 0) { 
      !echo -a No Network specified 
      halt 
    }
    if ($regex($2,/[A-Z0-9]/i) == 1) && ($regex($3-,/[A-Z0-9]/i) == 1) {
      !echo -a Syntax : /ajoin -c  
      halt    
    }
    if ($regex($2,/[A-Z0-9]/i) == 1) && ($regex($3-,/[A-Z0-9]/i) == 0) { 
      var %exa = $iif($hfind(Ajoin,$2),$true,$false)
      if (%exa == $true) {      
        !.echo -q $regsub($2,,,%rne)
        .hdel Ajoin %rne    
        !echo -a Removed $2 from Database 
      }  
      elseif (%exa == $false) {
        !echo -a No such $2 in Database
      }          
    }
  }
  if ($regex($1,/^-g$/i) == 1) {
    if ($regex($2,/[A-Z0-9]/i) == 0) {
      !echo -a No Network Specified
      halt    
    }
    if ($regex($2,/[A-Z0-9]/i) == 1) && ($regex($3-,/[A-Z0-9]/i) == 1) {
      !echo -a Syntax : /ajoin -g 
      halt
    }
    if ($regex($2,/[A-Z0-9]/i) == 1) && ($regex($3-,/[A-Z0-9]/i) == 0) {
      var %exa = $iif($hfind(Ajoin,$2),$true,$false)
      if (%exa == $true) {  
        !echo -a Channels from $2 :
        .echo -q $regsub($hget(Ajoin,$hfind(Ajoin,$2)),/\s/g,$chr(44),%j)
        !echo -a %j
      }
      elseif (%exa == $false) {
        !echo -a No such $2 in Database
      }
    }
  }
  if ($regex($1,/^-r$/i) == 1) {
    if ($regex($2,/[A-Z0-9]/i) == 0) {
      !echo -a No Network Specified
      halt
    }
    if ($regex($3,/[A-Z0-9]/i) == 0) {
      !echo -a No Channel Specified
      halt    
    } 
    if ($regex($4-,/[A-Z0-9]/i) == 1) {
      !echo -a Syntax : /ajoin -r  
      halt    
    } 
    if ($regex($3,/[&%#]\S+/xig) == 0) {
      !echo -a Channel Must Have $eval(#,0) Prefix At The Beginning 
      halt    
    }
    if ($regex($3,/[&%#]\S+/xig) == 1) && ($regex($4-,/[A-Z0-9]/i) == 0) {
      var %find = $findtok($hget(Ajoin,$2),$3,1,32)
      var %find2 = $deltok($hget(Ajoin,$2),%find,32)    
      .hadd -m Ajoin $2 %find2
      !echo -a Removed $3 from $2
    }
  }
  if ($regex($1,/^-d$/i) == 1) {
    if ($regex($2-,/[A-Z0-9]/i) == 1) {
      !echo -a Wrong syntax : /ajoin -d
      halt
    }
    if ($regex($2-,/[A-Z0-9]/i) == 0) {
      .hfree Ajoin
      !echo -a Deleted Auto Join Database
    }
  }
  if ($regex($1,/^-Mg$/i) == 1) {
    if ($regex($2-,/[A-Z0-9]/i) == 1) {
      !echo -a Wrong syntax : /ajoin -Mg
      halt
    }
    if ($regex($2-,/[A-Z0-9]/i) == 0) {
      var %a = 1
      !echo -s Listing Networks and Auto Join Channels ...
      !echo -s $chr(160) 
      while (%a <= $hget(Ajoin,0).item) {
        !echo -s -        
        !echo -s $hget(Ajoin,$ifmatch).item : $replace($hget(Ajoin,$hget(Ajoin,$ifmatch).item),$chr(32),$chr(44)) 
        !echo -s -      
        inc %a
      }
      !echo -s -------
      !echo -s End Of /ajoin -Mg command
      !echo -s -------
    }
  }
  if ($regex($1,/^on$/i) == 1) {
    if ($regex($2-,/[A-Z0-9]/i) == 1) {
      !echo -a Wrong syntax : /ajoin on
      halt
    }
    if ($regex($2-,/[A-Z0-9]/i) == 0) {
      set %ajoin on
      !echo -a Auto Join set to On
    }
  }
  if ($regex($1,/^off$/i) == 1) {
    if ($regex($2-,/[A-Z0-9]/i) == 1) {
      !echo -a Wrong syntax : /ajoin off
      halt
    }
    if ($regex($2-,/[A-Z0-9]/i) == 0) {
      set %ajoin off
      !echo -a Auto Join set to Off
    }
  }
  if ($regex($1-,/[A-z0-9]/ig) == 0) {
    if (%ajoin == $null) {
      echo -a Please enable or disable the Auto Join by typing /ajoin [on|off]
      halt
    }
    elseif (%ajoin != $null) {
      !echo -a Auto Join is currently  $+ $iif(%ajoin == on,Enabled,Disabled)    
    }
  }
}

on *:connect:{
  if (%ajoin == on) {
    var %nexists $iif($hget(Ajoin,$network),true,false) 
    if ($regex(%nexists,/^false$/i) == 1) {
      halt      
    }
    elseif ($regex(%nexists,/^true$/i) == 1) {
      .join $replace($hget(Ajoin,$network),$chr(32),$chr(44))
    }
  }
}

on *:start:{
  .hmake -s Ajoin 1000
  if ($isfile(Ajoin.dat)) { hload Ajoin Ajoin.dat }
}

on *:exit:{ .hsave -o Ajoin Ajoin.dat }
on *:disconnect:{ .hsave -o Ajoin Ajoin.dat }
on *:unload:{ 
  !.unset %ane
  !.unset %rne
  !.unset %j
  !.unset %ajoin
  !.unset %lmnop
}
__________________
Reply With Quote
  #2  
Old 02-03-2006, 01:49 PM
BilbOuL's Avatar
BilbOuL BilbOuL est déconnecté
Registered User
 
Join Date: Aug 2004
Location: Beirut - Dahieh
Posts: 225
BilbOuL is a jewel in the roughBilbOuL is a jewel in the roughBilbOuL is a jewel in the roughBilbOuL is a jewel in the rough
Send a message via AIM to BilbOuL Send a message via MSN to BilbOuL Send a message via Yahoo to BilbOuL
Re: auto join

cult kaza marra 3ataytne remote ma yezbato bas la jarib hayda
__________________
I Love AngelSoul :*
Reply With Quote
  #3  
Old 03-03-2006, 06:23 PM
Cult's Avatar
Cult Cult est déconnecté
Registered User
 
Join Date: Jan 2005
Location: Lebanon
Posts: 2,124
Cult is a jewel in the roughCult is a jewel in the roughCult is a jewel in the rough
Send a message via MSN to Cult
Re: auto join

Quote:
Originally Posted by BilbOuL
cult kaza marra 3ataytne remote ma yezbato bas la jarib hayda

2ee shoo sar ma3ak khayye?
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
American nun, priest join Gaza standoff (AP) TheGodFather News Articles and Links And Political Discussion! 0 22-11-2006 07:44 PM
Hezbollah 'to join talks on Lebanon unity government' (AFP) TheGodFather News Articles and Links And Political Discussion! 0 26-10-2006 09:19 PM
What time do you join Tchatting Thugilex The Lounge 47 08-10-2005 08:10 PM
tinny auto join dialog Cult mIRC :: SCRIPTING & HELP 0 13-09-2005 04:17 PM
Auto Msg On Join DreamS mIRC :: SCRIPTING & HELP 8 10-03-2005 12:16 PM

All times are GMT. The time now is 08:52 AM.
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
All data and information are copyright of DOTLeb Network