mIRC Homepage
Posted By: JuZt3r !admin_vote_kick ;D - 07/07/03 03:13 PM
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
Posted By: pheonix Re: !admin_vote_kick ;D - 07/07/03 03:16 PM
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
}
Posted By: JuZt3r Re: !admin_vote_kick ;D - 07/07/03 03:51 PM
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
Posted By: pheonix Re: !admin_vote_kick ;D - 07/07/03 04:05 PM
use the 1 i gave you, there is nothing wrong with the 1 i gave you.
Posted By: JuZt3r Re: !admin_vote_kick ;D - 07/07/03 04:18 PM
its the one you gave me, i just changed the kick # nick, with msg bot kick nick..
Posted By: pheonix Re: !admin_vote_kick ;D - 07/07/03 04:19 PM
well that will just send a message.
Posted By: JuZt3r Re: !admin_vote_kick ;D - 07/07/03 04:23 PM
send a msg to the bot, who will kick for me ;D
i still get the * /if: invalid format
Posted By: pheonix Re: !admin_vote_kick ;D - 07/07/03 04:41 PM
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
}
Posted By: JuZt3r Re: !admin_vote_kick ;D - 07/07/03 04:55 PM
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 ?
Posted By: KingTomato Re: !admin_vote_kick ;D - 07/07/03 06:01 PM
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
Posted By: neophyte Re: !admin_vote_kick ;D - 08/07/03 02:37 AM
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 Discussion Forums