mIRC Home    About    Download    Register    News    Help

Print Thread
#34659 07/07/03 03:13 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
Hi, im trying to make my self a admin_vote_kick script or somthing.
this is what i made
on *:text:!admin_vote_kick*:#TOG: {
set %no 0
set %yes 0
timer 1 70 if(%yes > %no kick $1 Du har blit vota ut..)
timer 1 80 unset %no
timer 1 80 unset %yes
}

on *:text:!yes:#tog: {
inc %yes 1
}
on *:text:!no:#TOG: {
inc %no 1

can somone se what is wrong. and please help me;D

#34660 07/07/03 03:16 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
on *:text:!admin_vote_kick*:#TOG: {
set %nick $nick
set %no 0
set %yes 0
.timer 1 70 if (%yes > %no) { kick # %nick Du har blit vota ut.. }
.timer 1 80 unset %no
.timer 1 80 unset %yes
.timer 1 80 unset %nick
}

on *:text:!yes:#TOG: {
inc %yes 1
}
on *:text:!no:#TOG: {
inc %no 1
}


new username: tidy_trax
#34661 07/07/03 03:51 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
on *:text:!admin_vote_kick*:#chan: {
set %nick $nick
set %no 0
set %yes 0
.timer 1 70 if (%yes > %no) { msg =dccbot .kick #chan nick Du har blit vota ut.. }
.timer 1 80 unset %no
.timer 1 80 unset %yes
.timer 1 80 unset %nick
}

on *:text:!yes:#chan: {
inc %yes 1
}
on *:text:!no:#chan: {
inc %no 1
}

this i use, but i get a * /if: invalid format
dont know what that means. so what to do!
im sure the if thing is wrong placed or somthing ;D. Im not so leet as you guys

#34662 07/07/03 04:05 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
use the 1 i gave you, there is nothing wrong with the 1 i gave you.


new username: tidy_trax
#34663 07/07/03 04:18 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
its the one you gave me, i just changed the kick # nick, with msg bot kick nick..

#34664 07/07/03 04:19 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
well that will just send a message.


new username: tidy_trax
#34665 07/07/03 04:23 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
send a msg to the bot, who will kick for me ;D
i still get the * /if: invalid format

Last edited by JuZt3r; 07/07/03 04:45 PM.
#34666 07/07/03 04:41 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
on *:text:!admin_vote_kick*:#: {
set %nick $nick
set %no 0
set %yes 0
.timer 1 70 if (%yes > %no) { msg =dccbot .kick # %nick Du har blit vota ut.. }
.timer 1 80 unset %no
.timer 1 80 unset %yes
.timer 1 80 unset %nick
}

on *:text:!yes:#: {
inc %yes 1
}
on *:text:!no:#: {
inc %no 1
}


new username: tidy_trax
#34667 07/07/03 04:55 PM
Joined: Dec 2002
Posts: 14
J
JuZt3r Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2002
Posts: 14
found the problem
the if thingi coldt not be in a timer. so i made a alias to work with it. now it looks like this

on *:text:!admin_vote_kick*:#chan: {
set %nick $2
set %no 0
set %yes 0
msg # $nick started a vote on $1 $+ ! You have 60 sec to vote !yes or !no
.timer 1 60 votekick
.timer 1 80 unset %no
.timer 1 80 unset %yes
.timer 1 80 unset %nick
}

on *:text:!yes:#chan: {
inc %yes 1
}
on *:text:!no:#chan: {
inc %no 1
}

alias votekick {
if (%yes > %no) { msg =togbert .kick # %nick You have been voted out.( $+ %yes yes, vs %no No }
}

But how can i fix like, they cant vote_kick ops, and use !yes more then once ?

Last edited by JuZt3r; 07/07/03 05:30 PM.
#34668 07/07/03 06:01 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Here is a different version. I added the group to make the vote only work when its active, as well as restrict multiple votes. Also, it has a nickname checksum that allows only users in the channel to be voted. You can also add the ability for ops to only vote by sett %vote.onlyOp to 1 in the !admin_vote_kick event.

Code:
alias vote.end {
  if ($1 == $null) {
    var %yes = %vote.yes, %no = %vote.no, %total = $nick(%vote.chan, 0)
    if (%yes > %no) {
      /msg %vote.chan Vote to kick Passed: %yes to %no with $calc(%total - (%yes + %no)) absesions
      /kick %vote.chan %vote.nick Kicked by vote( $+ %yes to %no $+ )
    }
    else if (%yes < %no) /msg %vote.chan Vote to kick Failed: %no to %yes with $calc(%total - (%yes + %no)) absesions
    else /msg %vote.chan Vote to kick Failes: %yes to %no $calc(%total - (%yes + %no)) absesions
  }
  .disable #voteKick
  /unset %vote.*
}

on @*:TEXT:!admin_vote_kick *:#: {
  if ($$2 ison $chan) {
    if ($group(#voteKick) == off) {
      .enable #voteKick
      /set %vote.yes 0
      /set %vote.no 0
      /set %vote.chan $chan
      /set %vote.nick $$2
      /set %vote.onlyOps 0
      .timer 1 60 /vote.end
    }
  }
  else /msg $chan Invalid nickname.  User is not on channel.
}

#voteKick off
on 1:TEXT:!*:%vote.chan: {
  ; op guard
  if (($nick !isop $chan) && (%vote.onlyOps)) {
    /vote.end kill
    return
  }

  if (!%vote. [ $+ [ $nick ] ]) {
    if ($1 == !yes) /inc %vote.yes
    else if ($$1 == !no) /inc %vote.ne
    /inc %vote. [ $+ [ $nick ] ]
  }
}
#voteKick end


-KingTomato
#34669 08/07/03 02:37 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Wouldn't this work better with a !vote yes as well as a !vote no text event.


An an on Input to call the vote?


Just some suggestions :P


--------
mIRC - fun for all the family (except grandma and grandpa)

Link Copied to Clipboard