mIRC Home    About    Download    Register    News    Help

Print Thread
#107180 07/01/05 07:02 PM
Joined: Jan 2005
Posts: 2
T
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: Jan 2005
Posts: 2
I want a script for my bot that voices and op only the users in the list, example: users.ini
To do something like that
TecnoVM64 has joined to #TestChan
TecBot sets mode +o TecnoVM64

and the same with the voices.

Thanks in advance

#107181 07/01/05 07:19 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
alias add { .writeini users.ini Users $1 | .echo -a ** Added $1 to auto op/voice list. }
alias rem { .remini users.ini Users $1 | .echo -a ** Removed $1 from auto op/voice list. }

on !*:JOIN:#: {
  if ($readini(users.ini,Users,$nick)) { 
    mode $chan +v $nick
    mode $chan +o $nick
    halt 
  }
}

Last edited by SladeKraven; 07/01/05 07:35 PM.
#107182 07/01/05 07:28 PM
Joined: Jan 2005
Posts: 2
T
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: Jan 2005
Posts: 2
Thnx. but how do i add the users?

#107183 07/01/05 07:33 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
There was a slight error in the code. Here's the final code.

Code:
alias add { 
  .writeini users.ini Users $1 $1 
  .echo -a ** Added $1 to auto op/voice list. 
}

alias rem { 
  .remini users.ini Users $1 $1
  .echo -a ** Removed $1 from auto op/voice list. 
}

on !*:JOIN:#: {
  if ($readini(users.ini,Users,$nick)) { 
    mode $chan +v $nick
    mode $chan +o $nick
    halt 
  }
}



Type /add <User>

/add Robert

* Robert has joined #Andy
* Andy sets mode: +v Robert
* Andy sets mode: +o Robert

#107184 08/01/05 02:23 AM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
Quote:
There was a slight error in the code. Here's the final code.

Code:
alias add { 
  .writeini users.ini Users $1 $1 
  .echo -a ** Added $1 to auto op/voice list. 
}

alias rem { 
  .remini users.ini Users $1 $1
  .echo -a ** Removed $1 from auto op/voice list. 
}

on !*:JOIN:#: {
  if ($readini(users.ini,Users,$nick)) { 
    mode $chan +v $nick
    mode $chan +o $nick
    halt 
  }
}



Type /add <User>

/add Robert

* Robert has joined #Andy
* Andy sets mode: +v Robert
* Andy sets mode: +o Robert

thetes a better way of doing it..
Code:
alias add { 
  .writeini users.ini Voicel  [color:green] $$1 $$1  [/color]
  .echo -ac info  ** Added $1 to auto op/voice list. 
}

alias rem { 
  .remini users.ini Voicel [color:green] $$1 $$1  [/color]
  .echo -ac info  ** Removed $1 from auto op/voice list. 
}

on [color:red]@[/color]*:JOIN:#: {
     [color:blue] $iif($readini(users.ini,voicel,$nick) == $nick,mode # +ov $nick $nick) [/color]
}

the green $$1s so you wont get an error saying * Writeini Error blah blah
and the red on @*:join so you wont get those two error messages if you dont have ops.
And the blue $iif .
and the echo -ac info im not sure if i did it right, but this is so it dosent echo as a black colour in a black background.
also consider that you will be giving ops to people who just change there nickname to a nick you have on the list and rejoining.

#107185 08/01/05 02:34 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You don't need the $iif since you are already checking if $nick is in users.ini.

Code:
alias add {   
  .writeini users.ini Voicel   $$1 $$1    
  .echo -ac info  ** Added $1 to auto op/voice list. 
}

alias rem {  
  .remini users.ini Voicel  $$1 $$1    
  .echo -ac info  ** Removed $1 from auto op/voice list. 
}

on @*:JOIN:#: {    
  if ($readini(users.ini,voicel,$nick)) { mode # +ov $nick $nick }
}

#107186 09/01/05 11:37 AM
Joined: Dec 2002
Posts: 145
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
I'm curious! What is the purpose for attributing a +v to a operator(+o)?

#107187 09/01/05 11:40 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I was pondering on that too but came to the conclusion it was his prerogative. grin

#107188 09/01/05 07:40 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Why don't you use mIRCs inbuilt auto-op & auto-voice lists?

You can find them in the Address book / 'Control' tab. Press Alt+B (or use the 6th icon from left on toolbar) and click on "Control", then look in the drop down combo.
Also see /help Control


Link Copied to Clipboard