mIRC Homepage

Test help

Posted By: tyler22

Test help - 09/08/05 08:27 PM

I have made a script, that if you join #irc it makes u take a test to see if the ? u have can be answered there. If you pass the test it voices you and you never have to take it again, thats the part i dont know how to do. here is what i have wrote. all i need it to do is if they pass the test it adds there address somewhere and when they join it voices them. The scripts are made in two files here is the first:
on *:JOIN:#IRC: {
.msg $nick In order for us to better help you, please take a short quiz. If you pass you will be voiced and never have to take it again. Type in !test to start | halt }
*Here is where if like they have not taken the test it sent them that msg and if they had than /mode #irc + v $nick
*Here is the 2nd part:
on *:TEXT:!test**:*: {
if ($2 == $null) && ($3 == $null) {
.msg $nick This test has 5 ?'s you must get all 5 ?'s right to pass lets begin.
/timer1 1 3 /msg $nick 7 1st Question
/timer2 1 5 /msg $nick Is your problem torncity relatead??? type in !test 1 yes/no. | halt }
if ($2 == 1) && ($3 == yes) { /ban -ku7200 #irc $address | /timer1 1 2 /kick #irc $nick WRONG ANSWER | /timer2 1 2 /msg $nick THIS CHANNEL IS FOR IRC QUESTION'S ONLY YOU CAN RETAKE THE QUIZ IN 2 HRS. | halt }
if ($2 == 1) && ($3 == no) { .msg $nick Corect answer next question
.timer1 1 2 /msg $nick 7 2nd question
.timer2 1 3 /msg $nick Is your question about your nickname??? Type in !test 2 yes/no }
if ($2 == 2) && ($3 == yes) { /ban -ku7200 #irc $address | /timer1 1 2 /kick #irc $nick WRONG ANSWER | /timer2 1 2 /msg $nick THIS CHANNEL IS FOR IRC QUESTION'S ONLY YOU CAN RETAKE THE QUIZ IN 2 HRS. | halt }
if ($2 == 2) && ($3 == no) { .msg $nick Corect answer next question
.timer1 1 2 /msg $nick 7 Final question
.timer2 1 3 /msg $nick Is your question about a channel like how to register it??? Type in !test 3 yes/no }
if ($2 == 3) && ($3 == yes) { /ban -ku7200 #irc $address | /timer1 1 2 /kick #irc $nick WRONG ANSWER | /timer2 1 2 /msg $nick THIS CHANNEL IS FOR IRC QUESTION'S ONLY YOU CAN RETAKE THE QUIZ IN 2 HRS. $+ | halt }
if ($2 == 3) && ($3 == no) { .msg $nick Corect answer you have passed the test, you will no longer have to take this test. | /timer4 1 2 /mode #irc +v $nick
.msg $nick This test has 5 ?'s you must get all 5 ?'s right to pass lets begin.
/timer1 1 3 /msg $nick 7 1st Question
/timer2 1 5 /msg $nick Is your problem torncity relatead??? type in !test 1 yes/no.
*If they made it all the way to the end than it adds their $address somewhere and at the first file voices them so they dont have to take the test again. You can change what ever u need to to make it work just give suggestion's even though i have no clue what to do crazy
Posted By: SladeKraven

Re: Test help - 10/08/05 04:57 AM

When putting code onto the forum for many reasons we ask that you please use the code tags so we can read it suffciently..

Here's an example of how it can be done, but requires a text file for your questions and a infront of the * goes the answer.

Code:
On @*:Join:#IRC: {
  if (!$hget(vnick,$nick)) {
    .msg $nick Hello $nick welcome to channel, in order to be voiced we require you take our test.
    .msg $nick Type !test to take our short 5 question test.
    .enable #test
  }
  else { mode $chan +v $nick }
}

;This is to their advantage to read th questions before answering so they can take a breather and get more familiar questions, hehe.

On *:Text:!test:?: {
  var %x = 1
  while (%x <= $lines(q.txt)) {
    .timer 1 %x .msg $nick $gettok($read(q.txt,%x),1,42)
    inc %x
  }
  .msg $nick To answer the questions type !test <Question Number> [yes|no]
}

#test off
On *:Text:!test & &:?: {
  if ($read(q.txt,$2) && $3 == $gettok($read(q.txt,$2),2,42) && ($2 != 5)) { 
    .msg $nick Question $2 correct.
  }
  elseif ($read(q.txt,$2) && ($3 == $gettok($read(q.txt,$2),2,42) && $2 == 5)) { 
    .msg $nick Question 5 correct!
    .msg $nick that completes our test.
    hadd -m vNick $nick $address($nick,2)
    mode $v2 +v $nick
    .disable #test
  }
  else { 
    if ($me isop #IRC) {
      ban -ku7200 #irc $nick 2 I'm sorry that is an incorrect answer.
      .disable #test
      .ignore $nick
    }
  }
}

#test end



The text file must look like:

1 Is your problem torncity related?*yes
2 Is your question about your nickname?*no
3 Some third question?*no
4 Some fourth question?*no
5 Some fifth question?*yes

You may change the questions, but leave the 1,2,3,4,5 down the side in place when adding an answer its vital it's in the format of question*answer like most trivia questions layed out.

!test 1 no

*Bans the user

*MSG's the user

*Ignore's the user


!test 1 yes

*Add's user to Hash Table for future reference (until you close mIRC) although a minor addition will sort it so the data gets saved when mIRC closes.

*Gives user voice (+v) status.

* MSG's the user.

*Wont require the user to take test again, that's unless you close mIRC so data isn't saved. Again data can be saved if you so wish: /help /hsave.

-Andy
Posted By: tyler22

Re: Test help - 11/08/05 01:15 AM

great script...one huge problem...when someone types in
!test the first time to see the 1st ? it kicks and bans them as soon as they do i get this error msg...

Code:
  (Error): Unknown command (#TEST)
 (Error): Unknown command (ON)
 (Error): Unknown command (#TEST) 


No idea how to fix it and the text file needs to be named q.txt right??
Posted By: tactix

Re: Test help - 11/08/05 10:59 PM

I thought you were sapposed to be a scripter. If you cannot fix it then you don't need to use it!
Posted By: tyler22

Re: Test help - 11/08/05 11:09 PM

where did i say i was a scripter??? I no alittle about mirc scripting, thats why i asked the ? i dont no how to do scripts like this im learning, it takes time someone cant just learn everythign over night. Now does anyone have a postive resoponse to my ?.
Posted By: DaveC

Re: Test help - 12/08/05 04:48 AM

Quote:
Code:
  (Error): Unknown command (#TEST)
 (Error): Unknown command (ON)
 (Error): Unknown command (#TEST) 


You altered his code to produce that effect, try coping it exactly as shown.
If you have to, cut and paste it into wordpad, then cut and paste it from there into mircs script editor.
© 2021 mIRC Discussion Forums