mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I am trying to make this command add the command it adds to a text file, here is how far i've gotten:
Code:
on $*:text:/^!addcom !?(\S+)/iS:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    msg $chan added $$2 to commands!
    writeini allcommands.ini commands $regml(1) $$3-
    write -c commandsresonse.txt
    .timerWritec 1 1 write -il1 commandsresonse.txt the current commands and their info for the bot http://bit.ly/PBBcommands $+ , ! $+ $regml(1)
  }
}

the thing is, it only has 1 command after the link, and i cannot find how to get it to add multiple commands without it being on separate lines. Please help.
Also would like this to delete the selected command from the line:
Code:
on $*:text:/^!delcom !?(\S+)/iS:#:{
  if ($read(sreglist.txt,nw,$nick)) {
    msg $chan removed $$2 from commands!
    remini allcommands.ini commands $regml(1)
  }
}

Thanks!


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Code:
on $*:text:/^!addcom !?(\S+)/iS:#:{
  if ($read(sreglist.txt,nw,$nick)) && ($3 != $null) {
    msg $chan added $2 to commands!
    writeini allcommands.ini commands $regml(1) $3-

    var %text $read(commandsresonse.txt,1)
    if %text == $null {
      var %line the current commands and their info for the bot http://bit.ly/PBBcommands $+ , ! $+ $regml(1)
    }
    else {
      var %line %text ! $+ $regml(1)
    }

    write -l1 commandsresonse.txt %line
  }
}

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
awesome! any way i cam get delcom to remove the command it deletes from the file?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Code:
on $*:text:/^!delcom !?(\S+)/iS:#:{
  if ($read(sreglist.txt,nw,$nick)) && ($2 != $null) {
    msg $chan removed $2 from commands!
    remini allcommands.ini commands $regml(1)

    var %text $read(commandsresonse.txt,1)
    if %text != $null {
      var %line $remove(%text,! $+ $regml(1))
    }

    write -l1 commandsresonse.txt %line 
  }
}


Link Copied to Clipboard