mIRC Home    About    Download    Register    News    Help

Print Thread
#249382 26/11/14 10:31 PM
Joined: Nov 2014
Posts: 17
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Nov 2014
Posts: 17
I need some help setting this up so it's fully working. I need it to add points to my current points system (Posted below). I want the trivia script to randomly pick a question. (How I would like it to be done: Question1.txt Answer1.txt and so on. I would also like it to add 5 points per correct question. Or if it can be done have harder questions so people can get more points, kinda like jeopardy(EX: 5 points easy question, 10 points mid question, 15 points hard question, 20 points extreme question) and maybe have a command for if no one can get the question right to reset it.

If anyone can help me that would be awesome since I am just starting mIRC.
And yes I have tried getting it to work and I can't seem to figure it out.

Both these scripts are not mine.


Trivia Script
Quote:

on $*:TEXT:/^!question?$/Si:#: {
if ((%floodscramble) || ($($+(%,floodage.,$nick),2))) { return }
set -u10 %floodscramble On
set -u10 %floodscramble $+ $nick On
if $($+(%,scram.scramword.,$chan),2) {
.msg $chan /me MrDestructoid There's already a trivia game going! The current question is $qt(%scram.scramword. [ $+ [ $chan ] ])
}
else {
set $lower($+(%,scram.origword.,$chan) $read(FILE.TXT,n))
set $lower($+(%,scram.scramword.,$chan) $scramble(%scram.origword. [ $+ [ $chan ] ]))
.msg $chan /me MrDestructoid $qt(%scram.scramword. [ $+ [ $chan ] ]) $+ . Type !guess (Your guess here). Make sure to include the appropriate space(s)!
}
}

on $*:TEXT:/^!guess/Si:#: {
if $lower($($+(%,scram.scramword.,$chan),2)) {
if ($2- != %scram.origword. [ $+ [ $chan ] ]) { return }
else {
writeini TriviaPoints.ini points $nick $iif($readini(TriviaPoints.ini,points,$nick),$calc($readini(TriviaPoints.ini,points,$nick) + 5),5)
.msg $chan /me MrDestructoid That's correct! Great job $nick $+ ! You now have $readini(TriviaPoints.ini,points,$nick) Points.
unset $+(%,scram.*.,$chan)
}
}
}

on $*:TEXT:/^!points?/Si:#: {
if ((%floodpts) || ($($+(%,floodpts.,$nick),2))) { return }
set -u5 %floodpts On
set -u15 %floodpts $+ $nick On
if (!$2) {
.msg $chan /me MrDestructoid You have $iif($readini(TriviaPoints.ini,points,$nick),$readini(TriviaPoints.ini,points,$nick),0) points $nick $+ .
}
else {
.msg $chan /me MrDestructoid $2 has $iif($readini(TriviaPoints.ini,points,$2),$readini(TriviaPoints.ini,points,$2),0) points.
}
}

on $*:TEXT:/^!resetpoints?/Si:#: {
if (!$2) {
writeini TriviaPoints.ini points $nick 0
.msg $chan /me MrDestructoid You have $iif($readini(TriviaPoints.ini,points,$nick),$readini(TriviaPoints.ini,points,$nick),0) points $nick $+ .
}
}


Points Script
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:#:{
msg # $nick has $iif($readini(Points.ini,$+(#,.,$nick),Points),$v1,0) total points.
}
on $*:text:/!points (add|remove|del)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove|del> <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 120 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -eu10 %floodjoin On
set -eu30 %floodjoin. $+ $nick On
msg $chan $nick has joined the channel and is now earning points.
}

ON *:KICK:#: {
if ($knick !== $me) {
$+(.timerpoints.,#,.,$knick) off
if ((%floodkick) || ($($+(%,floodkick.,$knick),2))) { return }
set -eu10 %floodkick On
set -eu30 %floodkick. $+ $nick On
msg $chan $knick has left the channel and is no longer earning points.
}
}

ON !*:QUIT: {
$+(.timerpoints.,#,.,$nick) off
if ((%floodquit) || ($($+(%,floodquit.,$nick),2))) { return }
set -eu10 %floodquit On
set -eu30 %floodquit. $+ $nick On
msg $chan $nick has left the channel and is no longer earning points.
}

ON !*:PART:#: {
$+(.timerpoints.,#,.,$nick) off
if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
set -eu10 %floodpart On
set -eu30 %floodpart. $+ $nick On
msg $chan $nick has left the channel and is no longer earning points.
}

alias add.pts { if ($1) { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) } }

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Did you try Tat's trivia? Probably one of the best trivia scripts out there. It has a ton of different functions, and I'd imagine you can easily customize it to what you need.

Joined: Nov 2014
Posts: 17
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Nov 2014
Posts: 17
I looked at tat's trivia. Like I said I'm new to Mirc so to me this is a maze with no exit. If I could get help with setting it up with the points system I have that would be awesome.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
If you don't know how to load a script in mIRC, read the readme.txt that's in the .zip file. After loading it, connect to any server and join a channel. Right click in the channel and go to Trivia options. Click the "Defaults" tab, then "themes". In there you can specify different questions.txt files for each of your themes, and give them their own points value.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I think his problem is he doesn't know how to incorporate features of one script with another. For example; the alias used here:
Code:
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
}
is used to add points to users by using "doaddpoints $chan $nick value"


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Nov 2014
Posts: 17
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Nov 2014
Posts: 17
I know how to load the script, I just want tat's trivia to add points to my existing points.ini file.

And I can't seem to find the alias for adding points.

And when I run it it get this in chat. Like whats with all the extra numbers?

"0Starting the trivia. Round of14 100 questions.14 !strivia0 to stop. Total:14 4993"

"1410.14 In what year did the Cold War begin?"

"0Here's a hint,14 19__"

Last edited by TheCanadian; 30/11/14 07:26 PM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Re-read what Nillen said and you will find the way for.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Nov 2014
Posts: 17
T
Pikka bird
OP Offline
Pikka bird
T
Joined: Nov 2014
Posts: 17
I've looked in the code several time and I see nothing that says add points.And when I run it it get this in chat. Like whats with all the extra numbers?

"0Starting the trivia. Round of14 100 questions.14 !strivia0 to stop. Total:14 4993"

"1410.14 In what year did the Cold War begin?"

"0Here's a hint,14 19__

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You have no experience whatsoever with real irc servers, right?
This script is "optimized" for an irc server and not the twitch server which isn't a true irc server. That's where the "extra" numbers you mentioned come in

To add points, I literally stated the entire process of doing so, you just need to add it somewhere in your code where you want to add points.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard