Author Topic: Help With a Custom Command  (Read 2130 times)

0 Members and 1 Guest are viewing this topic.

WasabiIceCream

  • Youngling
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
    • Gameoverse
  • Twitch Name: Gameoverse
Help With a Custom Command
« on: February 08, 2016, 04:04:52 AM »
Hey, wondering if anyone could help me out with a custom command I've been wanting to do.
I've been trying to work with the limitations of the bot's custom variables with no luck so far.
What I want is a command that users can run, spending points to redeem a random Steam/PSN/XBL game product key that I have stored in a Text file, or multiple text files.

Haven't been able to get things working, though. Tried storing info in a file "##.txt", and using the random variable to generate the name of the text file "3.txt", but the Random variable doesn't seem to work inside the Read File variable "@readfile@[PathToFile\@rand@[0|10].txt]".

I tried some other stuff, with no results. Any suggestions?

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Help With a Custom Command
« Reply #1 on: February 08, 2016, 04:33:21 AM »
Works for me:



Command:



Text Files located in the Custom logs folder of the Deepbot folder (C:\DeepBot - Twitch Streamer Assistant\custom logs):

Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport

MercurY3rd

  • Councilor
  • *****
  • Posts: 652
  • Karma: +26/-1
    • View Profile
  • Twitch Name: mercury3rd
Re: Help With a Custom Command
« Reply #2 on: February 08, 2016, 04:38:26 AM »
it seems to work, maybe you named the text files wrong?
http://mercury3rd.tv/uploads/2016-02-07-2133-54.mp4
Hier steht nichts Sinnvolles, dennoch freundliche Grüße. MercurY

WasabiIceCream

  • Youngling
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
    • Gameoverse
  • Twitch Name: Gameoverse
Re: Help With a Custom Command
« Reply #3 on: February 08, 2016, 04:44:59 AM »
Strange, I'll have to give it another shot.
Maybe I screwed something up.

WasabiIceCream

  • Youngling
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
    • Gameoverse
  • Twitch Name: Gameoverse
Re: Help With a Custom Command
« Reply #4 on: February 09, 2016, 05:58:22 AM »
EDIT: Or, scratch that... I'm an idiot

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Help With a Custom Command
« Reply #5 on: February 09, 2016, 06:26:23 AM »
EDIT: Or, scratch that... I'm an idiot

Did you figure it out?
Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport

WasabiIceCream

  • Youngling
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
    • Gameoverse
  • Twitch Name: Gameoverse
Re: Help With a Custom Command
« Reply #6 on: February 09, 2016, 06:57:23 AM »
Yeah, the only thing I want to solve now is preventing users from using commands in the middle of the command chain.
Like, if they use the "!buy3" command, they'll bypass the points and availability checks from the commands in the previous chain.
Setting the access control higher prevents the commands from being executed at all.

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Help With a Custom Command
« Reply #7 on: February 09, 2016, 07:33:41 AM »
Yeah, the only thing I want to solve now is preventing users from using commands in the middle of the command chain.
Like, if they use the "!buy3" command, they'll bypass the points and availability checks from the commands in the previous chain.
Setting the access control higher prevents the commands from being executed at all.

That is why you check mark hide from command list

Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport

WasabiIceCream

  • Youngling
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
    • Gameoverse
  • Twitch Name: Gameoverse
Re: Help With a Custom Command
« Reply #8 on: February 09, 2016, 09:50:57 AM »
Ah, cool gotcha.
Didn't know exactly what that option meant.

I've got it all working now.
If anyone wants the code, or wants to double-check it for logic errors, you can just ask.
Could probably be done much more efficiently than what I've done, but it works.
Thanks again.