mIRC Home    About    Download    Register    News    Help

Topic Options
#246065 - 22/05/14 01:05 AM mIRC errors?
judge2020 Offline
Fjord artisan

Registered: 21/03/14
Posts: 215
Loc: USA
for some reason when i tried making this new script it just said error for every command i was trying to do. Here is my script:
Code:
on *:TEXT:!giveaway start *:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    if (%giveaway == off) {
      	     set -e %giveaway on
      	     msg $chan giveaway started. Clearing old giveaway list. Please say " $+ $3 $+ " to enter the giveaway!
      	     write -c giveaway.txt
      	     write -c GiveawayWord.txt
      	     .timerWriteGiveawayWord 1 1 write GiveawayWord.txt $3 
    }
    elseif (%giveaway == on) msg $chan a giveaway is still on. please end it by saying "!giveaway end"		 
    else msg # error, please !giveaway end to fix this
  }
}
on *:TEXT:!giveaway end:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    set -e %giveaway off
    msg $chan Giveaway has ended. entries: $lines(giveaway.txt) $+ . Please do !draw to pick a winner!
  }
}
on *:text:!draw:#:{ 
  if ($read(sreglist.txt,nw,$nick)) {
    var %giveawaywinner = $read(giveaway.txt)
    if (%giveaway == off) { msg $chan The winner is %giveawaywinner $+ !! If you would like to pick another winner draw again. you can message mark here http://www.twitch.tv/message/compose?to=mark_paintball and you can message the winner here http://www.twitch.tv/message/compose?to= $+ %giveawaywinner }
    elseif (%giveaway == on) { msg $chan The giveaway is still on! please do "!giveaway end" }
  }
}
on *:text:*:#:{
  if (%giveaway == on) {
    if ($read(GiveawayWord.txt,nw,$1)) {
      if (!$read(giveaway.txt,nw,$nick)) {
        write giveaway.txt $nick
      }
    }
  }
}

Here is what my error log is:

Please help. Also feel free the fix up my script, i made it in 30 minutes and isn't the best quality.
_________________________
#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball

Top
#246067 - 22/05/14 01:31 AM Re: mIRC errors? [Re: judge2020]
Loki12583 Offline
Hoopy frood

Registered: 22/01/04
Posts: 1271
Did you edit this in another text editor with tabs instead of spaces?

Top
#246069 - 22/05/14 02:18 AM Re: mIRC errors? [Re: Loki12583]
judge2020 Offline
Fjord artisan

Registered: 21/03/14
Posts: 215
Loc: USA
Originally Posted By: Loki12583
Did you edit this in another text editor with tabs instead of spaces?

Ya that's probably it.
How do I fix this?
_________________________
#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball

Top
#246070 - 22/05/14 02:28 AM Re: mIRC errors? [Re: judge2020]
startgame Offline
Pikka bird

Registered: 17/05/14
Posts: 10
Loc: United States
Originally Posted By: judge2020
Originally Posted By: Loki12583
Did you edit this in another text editor with tabs instead of spaces?

Ya that's probably it.
How do I fix this?


Try this. I went ahead and fixed the space issue; just paste in mIRC and test. If you still are thrown the same errors, let me know and I will go through it.

Code:
on *:TEXT:!giveaway start *:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    if (%giveaway == off) {
      set -e %giveaway on
      msg $chan giveaway started. Clearing old giveaway list. Please say " $+ $3 $+ " to enter the giveaway!
      write -c giveaway.txt
      write -c GiveawayWord.txt
      .timerWriteGiveawayWord 1 1 write GiveawayWord.txt $3 
    }
    elseif (%giveaway == on) msg $chan a giveaway is still on. please end it by saying "!giveaway end"		 
    else msg # error, please !giveaway end to fix this
  }
}
on *:TEXT:!giveaway end:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    set -e %giveaway off
    msg $chan Giveaway has ended. entries: $lines(giveaway.txt) $+ . Please do !draw to pick a winner!
  }
}
on *:text:!draw:#:{ 
  if ($read(sreglist.txt,nw,$nick)) {
    var %giveawaywinner = $read(giveaway.txt)
    if (%giveaway == off) { msg $chan The winner is %giveawaywinner $+ !! If you would like to pick another winner draw again. you can message mark here http://www.twitch.tv/message/compose?to=mark_paintball and you can message the winner here http://www.twitch.tv/message/compose?to= $+ %giveawaywinner }
    elseif (%giveaway == on) { msg $chan The giveaway is still on! please do "!giveaway end" }
  }
}
on *:text:*:#:{
  if (%giveaway == on) {
    if ($read(GiveawayWord.txt,nw,$1)) {
      if (!$read(giveaway.txt,nw,$nick)) {
        write giveaway.txt $nick
      }
    }
  }
}

Top
#246071 - 22/05/14 03:18 AM Re: mIRC errors? [Re: startgame]
blessing Offline
Vogon poet

Registered: 03/04/14
Posts: 191
I prefer use variable instead of writing giveawayword to txt file.
Code:
on *:TEXT:!giveaway start *:#:{
  if ($read(sreglist.txt,nw,$nick)) && ($3 != $null) {
    if (%giveaway == off) || (%giveaway == $null) {
      set -e %giveaway on
      msg $chan giveaway started. Clearing old giveaway list. Please say " $+ $3 $+ " to enter the giveaway!
      write -c giveaway.txt
      set -e %giveawayword $3
    }
    elseif (%giveaway == on) msg $chan a giveaway is still on. please end it by saying "!giveaway end"		 
  }
}

on *:text:%giveawayword:#:{
  if (%giveaway == on) && !$read(giveaway.txt,nw,$nick)) {
    write giveaway.txt $nick
  }
}

Top
#246074 - 22/05/14 04:24 AM Re: mIRC errors? [Re: blessing]
judge2020 Offline
Fjord artisan

Registered: 21/03/14
Posts: 215
Loc: USA
Thanks for all the help!
_________________________
#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball

Top