mIRC Homepage
Posted By: Unknownmanc Please someone help - 08/04/16 11:22 AM
Hello. Perhaps this question has been asked on the forum, but I have not found. I want that after people write in the chat this command (for example !Addgame Garrysmod), the text "garrysmod" would be added to my own site to the list. To then I could choose one of the games selected by subscribers. How can I make something like this? Sorry for bad english.
Posted By: JB_uk Re: Please someone help - 18/04/16 01:00 AM
So you want subscribers to collectively write a list of games then you to choose?
If so, try this. It will allow users to use command !Addgame followed by a game, then it would write the list in a text file in your C:\Users\Administrator\AppData\Roaming\mIRC folder under the name GamesToPlay.txt.
Code:
on *:text:!Addgame *:#: {
  .write GamesToPlay.txt $2- Chosen by: $nick
  msg # $nick added $2- to the list 
}


If you wanted you could randomise the choice by using this. It would choose a random line to read from the file when you type !selectgame. Or you could just select manually by looking in the file.

Code:
on *:text:!selectgame:#: {
  var %Line $lines(GamesToPlay.txt)
  var %LineToRead $rand(1,%Line)

  msg # The next game to play: $read(GamesToPlay.txt,%LineToRead)
}


Let me know how you get on.
© mIRC Discussion Forums