mIRC Home    About    Download    Register    News    Help

Print Thread
#244924 05/04/14 10:50 PM
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
I'm making a twitch bot a was wondering how to make a command to describe who someone is like if i were to type "!whoisuser dude22072" it say one thing but if they typed !whoisuser randomuser" it'dd be something different. and if they typed in a user not on the list it'd say "sorry i dont know that user".

Last edited by dude22072; 05/04/14 10:50 PM.
Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
this part of scripting is not what i know to well, but i'd expect there to be a part of it that reads a text file of names and descriptions after the names. Also be a else command that would say "i don't know who that user is"


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Like Judge so elegantly put it, there's a need of storage where you can store this information about an user. How would you like to add this info?

Would you like to add this info through a command or add it to a text file to begin with? - Please provide as much info as you possibly can and I'll see what I can cook up for you.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
Text file initialy

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: Nillen
Like Judge so elegantly put it, there's a need of storage where you can store this information about an user. How would you like to add this info?

Would you like to add this info through a command or add it to a text file to begin with? - Please provide as much info as you possibly can and I'll see what I can cook up for you.

+1
-i would've put together a small script but i have no idea how to make a command read words after the first word #imAbeginner


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That's... Great.

Now, do you want to add those lines yourself? I suggest working with an .ini file for this, the output would be like this:

Quote:
[name]
Message=Whatever you want as a message.

[othername]
Message=Whatever you want for this person.


etc for each individual. Now, this would be simpler if you make and design the file through the mIRC client.

Give me all the details and I'll make it for you, don't just tell me that you want it to read from a file. - It tells me essentially nothing. Tell me who you want to be able to edit the file, how to edit the file, who is able to run this event and all other details you can think of.
I'll translate what you want to msl.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
Ok sorry ^^
I want it in a file, the way you said is fine.
I want users to be able to edit their own line via a command, and for mads to be able to edit anyone's line.
Anyone can use the command !whoisuser

(also for something else i'm doing do you know how to make a command only a certain user can use?)

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: dude22072

(also for something else i'm doing do you know how to make a command only a certain user can use?)

yes,
only 1 user:
Code:
on *:TEXT:!command*:#: {
  if ($nick == myusername ) {
    msg # gotta have limitations
  }
}

mod: only:
Code:
on *:TEXT:!command*:#: {
  if ($nick isop #) return
    msg # moderator only command
}

list of users: (note: must be able to write these users with something like this:
Code:
on *:TEXT:!reg add*:#: {
  if ($nick !isop #) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }

)

Code:
on *:TEXT:!to*:#: {
  if ($read(reglist.txt,nw,$nick)) {
    msg $chan timing out $$2 for $$3 seconds
    msg $chan .timeout $$2 $$3
  }
}

smile


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
TY judge2020

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
on *:text:!whois*:#: { 
  var %user $readini(users.ini, $2, Message) 
  if (%user == $null) { msg # No info recorded. | return }
  msg # User information: %user
}

on *:text:!user*:#: { 
  .writeini users.ini $nick Message $2- 
}

on *:text:!writeuser*:#: { 
if ($nick !isop #) return
  .writeini users.ini $2 Message $3- 
}


Anyone can write their own info with the !user <message> command like this. If a mod wants to change someones info, they type !writeuser <username> <message>.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That is just cancerous.

Let me clarify something on your codes.
Code:
on *:TEXT:!command*:#: {
  if ($nick isop #) return
    msg # moderator only command
}

Code:
on *:TEXT:!reg add*:#: {
  if ($nick !isop #) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
Both of these are just dead wrong.
if ($nick isop #) - If the user is an op (mod) in the channel.
if ($nick !isop #) - If the user is NOT an op (mod) in the channel.

What you're saying is if the user is an op, do nothing.
On the second one, anyone who is not an op can do that.



Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
oh sorry frown i'll be better in the future about this kinda stuff


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

Link Copied to Clipboard