mIRC Home    About    Download    Register    News    Help

Print Thread
Adding commands via chat #247869
02/09/14 01:45 AM
02/09/14 01:45 AM
Joined: Aug 2014
Posts: 26
S
Stracked Offline OP
Ameglian cow
Stracked  Offline OP
Ameglian cow
S

Joined: Aug 2014
Posts: 26
Hello, So i was looking for a full script on adding commands via chat (twitch.tv)
With the following:
!addcom !test test = adds command !test and advices
!editcom !test test test = edits the command
!delcom !test = deletes the command
!addcommod = command only for mods
!commandlist = list of commands

Thanks laugh

Re: Adding commands via chat [Re: Stracked] #247872
02/09/14 12:55 PM
02/09/14 12:55 PM
Joined: Feb 2014
Posts: 9
F
FlyingPotatoes Offline
Nutrimatic drinks dispenser
FlyingPotatoes  Offline
Nutrimatic drinks dispenser
F

Joined: Feb 2014
Posts: 9
I only have !addcom and !delcom but I think you can go from this and add your extra features:
Code:
on $*:text:/^!addcom !?(\S+)/iS:#:{
  if ($nick !isop #) return
  writeini commands.ini commands $regml(1) $$3-
  msg # $2 has been added!
}

on $*:text:/^!delcom !?(\S+)/iS:#:{
  if ($nick !isop #) return
  remini commands.ini commands $regml(1)
  msg # $2 has been removed!
}

Re: Adding commands via chat [Re: FlyingPotatoes] #247873
02/09/14 01:05 PM
02/09/14 01:05 PM
Joined: Aug 2014
Posts: 26
S
Stracked Offline OP
Ameglian cow
Stracked  Offline OP
Ameglian cow
S

Joined: Aug 2014
Posts: 26
This is pretty neat but I am still a noob at this kind of scripts So I would like some assistance to make a mod only addcom,Some way to edit the commands and also a command list... If somebody can help laugh

Re: Adding commands via chat [Re: Stracked] #247880
02/09/14 06:44 PM
02/09/14 06:44 PM
Joined: Feb 2014
Posts: 9
F
FlyingPotatoes Offline
Nutrimatic drinks dispenser
FlyingPotatoes  Offline
Nutrimatic drinks dispenser
F

Joined: Feb 2014
Posts: 9
mod only addcom? it is already mod only. I think you mean so that only mods can use it. In which case, I think I would make it specific commands (because it's way easier and let's face it, how many mod only commands will you need?). It would look like:
Code:
on *:TEXT:!modonly:#: { 
if($nick isop #){
  msg # This command can only be executed by a mod. 
}
else {
  msg # You can't use this command.
}
}


To be honest, I would read the forums and see how I can do that. It really isn't that hard. I made my own bot and besides the point system that I got from youtube, everything else I got from the forums and now my bot has a point system, raid command, add commands, polls, script that choses the user with most points and gives him mod, giveaway system based on points and many more...

Re: Adding commands via chat [Re: FlyingPotatoes] #247881
02/09/14 08:56 PM
02/09/14 08:56 PM
Joined: Aug 2014
Posts: 26
S
Stracked Offline OP
Ameglian cow
Stracked  Offline OP
Ameglian cow
S

Joined: Aug 2014
Posts: 26
True that...
But still Is there any way to edit commands with a command lol
And also a way to do a command list with all commands without having to add manually?

Last edited by Stracked; 03/09/14 12:39 AM.
Re: Adding commands via chat [Re: Stracked] #247889
03/09/14 08:19 PM
03/09/14 08:19 PM
Joined: Feb 2014
Posts: 9
F
FlyingPotatoes Offline
Nutrimatic drinks dispenser
FlyingPotatoes  Offline
Nutrimatic drinks dispenser
F

Joined: Feb 2014
Posts: 9
The commands are saved in commands.ini (located in %appdata%/mIRC/commands.ini). From there it's just a matter of reading that file and displaying it in some way (be it a website, chat iself [although I wouldn't recommend it] or whatever you may find)
I really have no idea how to edit commands tbh but I guess you could just delete it and create a new one

Re: Adding commands via chat [Re: FlyingPotatoes] #247891
03/09/14 08:57 PM
03/09/14 08:57 PM
Joined: Aug 2014
Posts: 26
S
Stracked Offline OP
Ameglian cow
Stracked  Offline OP
Ameglian cow
S

Joined: Aug 2014
Posts: 26
Yes i do know how to edit them manually but i wonder if there is a way so somebody else can for example a chat moderator
Also the way to open it is:
//run notepad.exe commands.ini

And.... figured out myself... thanks anyways

Last edited by Stracked; 04/09/14 01:52 AM.
Re: Adding commands via chat [Re: Stracked] #247909
07/09/14 03:21 PM
07/09/14 03:21 PM
Joined: Mar 2014
Posts: 215
USA
J
judge2020 Offline
Fjord artisan
judge2020  Offline
Fjord artisan
J

Joined: Mar 2014
Posts: 215
USA
Also
You can use the same !addcom command and change the text from addcom to editcom, then add a if statement to check for that command to be in the list. If you
Code:
writeini commands.ini $2 $3-
while $2 is already in the list it will just overwrite the $2 command
smile


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball