mIRC Home    About    Download    Register    News    Help

Print Thread
#117186 13/04/05 05:03 PM
Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
hi all
I wonder if any friend knows how to create a funny code.I have a bot in my channel and i want 2 thinks
a) to op and deop the users that i give access and they are opers in my channel with timer and enable -disable!
IE every 15 minutes to deop and after 15 minutes to op again!
and...
b) a code who repeat the last line in main channel (like repeating everyone who say anything) smile

(i want 2 different codes)..i ask too mutch ha? frown

Last edited by juble; 13/04/05 05:23 PM.
Joined: Feb 2005
Posts: 194
A
Vogon poet
Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Hehehehe. I'll help you on the mock code, but not the op one. I have to go in about 2 seconds. Anyway, here's the mock code:

Code:
on *:text:*:*:{ privmsg $chan $1- }


"God sometimes puts us in the dark for us to see the light"
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
1.

Change #Channel to your channel name
It is untested, but if it doesn't work I'll try working on it.

Code:
menu nicklist {
  Op Access
  .Add: {
    if (!$read(opaccess.txt,w,$address($$1,8))) {  
      write opaccess.txt $address($$1,8) 
      echo -a Added $$1 ( $+ $address($$1,8) $+ ) 
    }
    else { 
      echo -a $$1 ( $+ $address($$1,8) $+ ) is already in list.  
    }
  }
  .Del: {
    if ($read(opaccess.txt,w,$address($$1,8))) {  
      write -dw $+(",$address($$1,8),") opaccess.txt 
      echo -a Removed $$1 ( $+ $address($$1,8)
    }
    else {
      echo -a $$1 ( $+ $address($$1,8) $+ ) is not in list.  
    }
  }
  .-
  .Status
  ..On: { 
    op.chk
  }
  ..Off: { 
    .timeropaccess off
    .timerdeopaccess off
  }
}

alias op.chk {
  .timeropaccess 0 900 opaccess
  .timerdeopaccess 0 1800 deopaccess
}

alias opaccess {
  if ($me isop [color:red]#Channel[/color]) {
    var %x = $lines(opaccess.txt)
    while (%x) {
      if ($gettok($read(opaccess.txt,%x),1,33) ison [color:red]#Channel[/color]) && ($gettok($read(opaccess.txt,%x),1,33) !isop [color:red]#Channel[/color]) { mode [color:red]#Channel[/color] +o $v1 }
      dec %x
    }
  }
}

alias deopaccess {
  if ($me isop [color:red]#Channel[/color]) {
    var %x = $lines(opaccess.txt)
    while (%x) {
      if ($gettok($read(opaccess.txt,%x),1,33) ison [color:red]#Channel[/color]) && ($gettok($read(opaccess.txt,%x),1,33) isop [color:red]#Channel[/color]) { mode [color:red]#Channel[/color] -o $v1 }
      dec %x
    }
  }
}


2.

Code:
On *:Text:*:[color:red]#Channel[/color]: {
  msg $chan $nick said $1-
}


Right click on a nickname from the nicklist to add/remove enable/disable.

I hope this helps.

-Andy

Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
thank you my friends for your help
SladeKraven ..yes its work and i want to thank you for helping me.
I have one question only.The add-del session gives real acceess or is it temporary for only one time?
I think the code works for the opers that already have access either i check the add either not ??

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
By clicking 'Add' your adding users in the style of..
nick!*user@*.host.

Which means it will only op them if their nick, user and host match whats in the file its reading from. To access the op access list type /run opaccess.txt. It isn't temporary, the users will always be in the text file till you remove it.

Del deletes the entry from the text file.

Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
on this code slade how can i make it to replay not every last line but if they pass by three lines ..then to repeat ??
to repeat every three lines
Code:
  
On *:Text:*:#Channel: {
  msg $chan $nick said $1-
}

Last edited by juble; 14/04/05 04:32 PM.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:JOIN:#channel:{ unset $+(%,ontext.,$network,.,$chan,.*.1) | unset $+(%,ontext.,$network,.,$chan,.*.2) }
on *:TEXT:*:#channel:{
  if $len($($+(%,ontext.,$network,.,$chan,.,$nick,.2),2)) { msg $chan $nick said $($+(%,ontext.,$network,.,$chan,.,$nick,.2),2)) }
  set $+(%,ontext.,$network,.,$chan,.,$nick,.2) $($+(%,ontext.,$network,.,$chan,.,$nick,.1),2))
  set $+(%,ontext.,$network,.,$chan,.,$nick,.1) $1-
}

^ This waits tell someone says 3 lines then echos the 1st one, next line echos the next one etc etc.


Code:
on *:JOIN:#channel:{ unset $+(%,ontext.,$network,.,$chan,.*.1) | unset $+(%,ontext.,$network,.,$chan,.*.2) }
on *:TEXT:*:#channel:{
  if $len($($+(%,ontext.,$network,.,$chan,.,$nick,.2),2)) {
    msg $chan $nick said $($+(%,ontext.,$network,.,$chan,.,$nick,.2),2))
    msg $chan $nick said $($+(%,ontext.,$network,.,$chan,.,$nick,.1),2))
    msg $chan $nick said $1-
    unset $+(%,ontext.,$network,.,$chan,.,$nick,.*)
  }
  else {
    set $+(%,ontext.,$network,.,$chan,.,$nick,.2) $($+(%,ontext.,$network,.,$chan,.,$nick,.1),2))
    set $+(%,ontext.,$network,.,$chan,.,$nick,.1) $1-
  }
}

^ this one waits tell someone says 3 lines then echos all 3 of them then waits for 3 lines again.

I wasnt sure which way u ment

Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
nope ..i mean when someone say 3 or 4 lines then echos only the last line.
example:
<jim> hi all how are u?
<jane> nice
<john> we are ok
<sara> great jim how about u
<BOT> great jim how about u (repeat)

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:TEXT:*:#:  { channel.event.alias msg      $1- }
on *:ACTION:*:#:{ channel.event.alias describe $1- }
on *:NOTICE:*:#:{ channel.event.alias notice   $1- }
; $1 = &lt;msg/describe/notice&gt;
; $2-= message
alias channel.event.alias {
  inc -u86400 $+(%,onchannel.event.counter.for.,$network,.,$chan)
  if ($($+(%,onchannel.event.counter.for.,$network,.,$chan),2) &gt;= 3) {
    unset $+(%,onchannel.event.counter.for.,$network,.,$chan)
    $1 $chan $2-
  }
}


This covers TEXT, ACTION and NOTICE, and if dont want one?, simple remove the ON Event line for it.

Joined: Apr 2005
Posts: 38
J
juble Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Apr 2005
Posts: 38
thank you thank you smile

Last edited by juble; 16/04/05 07:49 AM.

Link Copied to Clipboard