mIRC Home    About    Download    Register    News    Help

Print Thread
#245607 29/04/14 09:16 PM
Joined: Nov 2013
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2013
Posts: 19
Hello, What i want to do is make my points system work with a giveaway script for my live stream, so that people with more points have a better chance of winning i have seen this done before but i don't know if it was coded in mIRC, Is this possible with mIRC?

i have both the scripts, i just don't know how to combine them.
i found both of these scripts on the forums.

Quote:
on *:TEXT:!giveaway enter:#:{
if (%giveaway == on) {
if (!$read(giveaway.txt,nw,$nick)) {
write giveaway.txt $nick
msg $chan $nick - you have been entered into the giveaway!
}
}
elseif (%giveaway == off) {
msg $chan There is no active giveaway
}
}
on *:TEXT:!giveaway start:#:{
var %giveaway = on
{ msg $chan giveaway started. please do "!giveaway enter" to enter. To clear all names, please do "!giveaway done" }
}
on *:TEXT:!giveaway end:#:{
var %giveaway = off
{ msg $chan Giveaway has ended. please do !draw to pick a winner!" }
}
on *:text:!giveaway done:#:{
var %giveaway = off
{ msg $chan giveaway is complete. erasing all names from the giveaway }
write $+(-ds,1) giveaway.txt
}
on *:text:!draw:#:{
if (%giveaway == off) { msg $chan The winner is $read(giveaway.txt) $+ !! If you would like to pick another winner draw again. }
elseif (%giveaway == on) { msg $chan The giveaway is still on! please do "!giveaway end" }
}




Quote:
alias -l addPoints {
if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
var %topic $+($chan,.,$nick)
var %points $calc($readini(Points.ini,%topic,Points) + $1)
writeini -n Points.ini %topic Points %points
return %points
}

alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Points.ini,%topic,Points)
return %points
}
alias doaddpoints {
if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
var %topic $+($1,.,$2)
var %points $calc($readini(Points.ini,%topic,Points) + $3)
writeini -n Points.ini %topic Points %points
echo -a Added points for %topic
}

alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}

on *:text:!points:#:{
if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
set -u10 %floodpoints On
set -u30 %floodpoints. $+ $nick On
msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}

on $*:text:/!points (add|remove)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
{ msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
}
else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}


Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
It is very much possible, pretty much anything you'd like is possible, you just gotta know how to do it. However, since this is a help forum and not a request forum I'm not going to do it for you, so I'm just here to tell you what you need to do.

Your points script will save a file called points.ini with each individual user's points separate. What you need to do with the giveaway is to read the giveaway.txt for every nick is in it, you'll need to know the number of lines for this which should be the first line of the file. So you'll want to write a new number in the file for each person who enters, at first it'll be 0, then 1, then 2 etc.
You'll need to use this number in a while loop to search for the #,.,%line (%line in this case is the $nick presented in the .txt) and evaluate all of these numbers which has the highest.

Then you'll wanna use these values and make an alias which states how high of a chance each point will give you.

Just ask whenever you stumble upon a roadblock and we'll help out. Use the help files for whatever you're wondering about first though, you'll find tons of useful information in there.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2013
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2013
Posts: 19
i am sorry but that all makes no sense to me frown
but i will keep trying and do some research maybe i can find something.


Link Copied to Clipboard