Author Topic: Redemption system for points  (Read 10622 times)

0 Members and 2 Guests are viewing this topic.

kidkerrigan

  • Youngling
  • *
  • Posts: 10
  • Karma: +1/-0
  • Twitch Streamer
    • View Profile
    • KidKerrigan.tv
  • Twitch Name: kidkerrigan
Redemption system for points
« on: April 10, 2016, 09:14:42 PM »
Hey all,

I didn't expect to ever write a tutorial on anything, but my viewers were starting to accumulate a lot of points (minerals) wihtout anything to do with them. Since I had some perks set up on GameWisp for subs, I figured viewers who've been around the most could also benefit from perks by using their minerals.

I couldn't find much info on setting something like this up, but manged to do it with the help of some of the tutorials here on the forums and with Mitch (thank you!).
Without further ado:

File set-up
Thanks to Mitch for suggesting this! As you can see, perks and their associated costs are stored in two different folders:


Inside each folder, there is a text file for each perk cost and perk name. These correspond to a  public FAQ for my viewers to choose their options.
E.g. Option 1: "You choose the class/hero I play next match" costs 1000 minerals


Bot commands
!kerriperks
Code: [Select]
/me  Welcome to KerriPerks!  Type "!redeem #" in chat, where # corresponds to the perk you'd like to redeem. You have @points@ @pointsname@ to spend. Check out the perks here: http://bit.ly/KerriPerksFAQProvides information to users on how to use KerriPerks (my perk redemption system). Take a look at the FAQ link for more context around why I designed some of the commands this way.

!redeem
Code: [Select]
@if@[>=||@points@||@readfile@[E:/LIVESTREAMS/StreamMods/bots/KerriBot/redeem/cost/@target@[1].txt]||!redeemlog @target@||!redeemfail]This is the only actionable command that initiates a redeeming a perk. Everything else is done automatically following this if condition. This will first check if the user has enough points to redeem the perk they want.

!redeemfail
Code: [Select]
You only have @points@ @pointsname@, @user@! Get back to the mines! kerriRageIf the user doesn't have enough points to redeem, they're told to try harder.


!redeemlog
Code: [Select]
@savefile@[E:\LIVESTREAMS\StreamMods\bots\KerriBot\redeem\unfulfilled\@target@[1]_@user@_@counter@.txt,@user@ | @readfile@[E:\LIVESTREAMS\StreamMods\bots\KerriBot\redeem\perk\@target@[1].txt] | @target@[2|50]]If the user does have enough points, the request is first logged in a new text file.

Some of my perks require more information from the viewer to be actionable, and I want users to provide that ASAP. E.g. custom greeting text, choose the hero I Play this match, etc. Due to the priority of some variables the log needs to be completed first, as it picks up 1) the perk # they have selected from @target@[1] to read from files, and 2) the remainder of the @target@ array as notes to include in the .txt file for me to refer to and action after the stream.

Command Chains (Hide these from Command List)

!redeemsuccess @target@

Code: [Select]
@editpoints@[@user@|-@readfile@[E:/LIVESTREAMS/StreamMods/bots/KerriBot/redeem/cost/@target@[1].txt]]Once the log has been created, the bot will edit the users points to remove however much the perk they nominated costs.


Note: You must include the @target@ variable when including these in the Chain Command field, or it won't carry whatever value or information that the user has input with the initial command.

!redeemsuccessmsg @target@
Code: [Select]
Yo, Kerri! @user@ redeemed the @readfile@[E:/LIVESTREAMS/StreamMods/bots/KerriBot/redeem/perk/@target@[1].txt] perk for @readfile@[E:/LIVESTREAMS/StreamMods/bots/KerriBot/redeem/cost/@target@[1].txt] @pointsname@! The points have been deducted, it's time to let the world know that someone redeemed a perk!

I chose to include a custom sound effect on this command, so it's more obvious. You can add an on-screen message as well, but I haven't worked out how to use OBS Remote with studio, so I skipped that. (If anyone knows, shoot me a message?)

!redeemthanks
Code: [Select]
@user@ has @points@ @pointsname@ left. Thank you for using KerriPerks! Not necessary, but thanks the user for participating and provides an update on their remaining points available.

The full successful command action looks like this:


And the "unfulfilled perks" folder contains logs of all perks that have been redeemed, including notes from the user, for my reference later on:

Untameable

  • Youngling
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
  • Twitch Name: thekid_gg
Re: Redemption system for points
« Reply #1 on: August 18, 2016, 11:05:09 PM »
Hello, Thank you so much for making this as this is exactly what I was looking for. I am having trouble getting the system to work right. !redeem # command does nothing for me even though I have copy and pasted everything exactly,editing only the "E/" drive to "C/" , I have also tried changing to bot folder names from kerribot to my own personal bot name. I am curious if anyone else has got this set up working perfectly.

Untameable

  • Youngling
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
  • Twitch Name: thekid_gg
Re: Redemption system for points
« Reply #2 on: August 19, 2016, 04:30:33 AM »
Hello, Thank you so much for making this as this is exactly what I was looking for. I am having trouble getting the system to work right. !redeem # command does nothing for me even though I have copy and pasted everything exactly,editing only the "E/" drive to "C/" , I have also tried changing to bot folder names from kerribot to my own personal bot name. I am curious if anyone else has got this set up working perfectly.

Correction. The !redeem # command works , !redeemfail works !redeemlog properly creates a folder. The issue I am having is with !redeemsuccess @target@  . It wont edit the points for some reason.

chikarkas36

  • Youngling
  • *
  • Posts: 22
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xcibermaniacosx
Re: Redemption system for points
« Reply #3 on: November 01, 2016, 01:43:47 AM »
How can create custom sound for every each viwer ? please help!

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Redemption system for points
« Reply #4 on: November 01, 2016, 04:55:45 AM »
How can create custom sound for every each viwer ? please help!

What do you mean?
Old Name: RepentGamingTV
Twitch: Here

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

chikarkas36

  • Youngling
  • *
  • Posts: 22
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xcibermaniacosx
Re: Redemption system for points
« Reply #5 on: November 02, 2016, 09:13:53 AM »
Like the custom join greetings chat but can play sound when they connect !

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Redemption system for points
« Reply #6 on: November 02, 2016, 10:13:56 AM »
Like the custom join greetings chat but can play sound when they connect !

You can set a command in custom join messages for each user. You then make the command play the audio file.
Old Name: RepentGamingTV
Twitch: Here

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

chikarkas36

  • Youngling
  • *
  • Posts: 22
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xcibermaniacosx
Re: Redemption system for points
« Reply #7 on: November 02, 2016, 12:50:45 PM »
The command need to be First? just the command or i cant mix like: !sound1 Welcome @user@ you are the man!

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Redemption system for points
« Reply #8 on: November 02, 2016, 01:36:04 PM »
The command need to be First? just the command or i cant mix like: !sound1 Welcome @user@ you are the man!

In the sound command, you can put the Welcome @user@ message in the command message part.
Old Name: RepentGamingTV
Twitch: Here

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

makimera

  • Youngling
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
  • Twitch Name: makimera
Re: Redemption system for points
« Reply #9 on: November 13, 2016, 06:30:44 PM »
Hi, been trying to use this redeemption system.
And i get the fail status to work, with "not enogh credits"

but i can't get the messages in "The full successful command action looks like this:"

It's just empty after i do "!redeem 1"
but it takes the points

ive copy and pasted everything, but still wont work for some reason

kidkerrigan

  • Youngling
  • *
  • Posts: 10
  • Karma: +1/-0
  • Twitch Streamer
    • View Profile
    • KidKerrigan.tv
  • Twitch Name: kidkerrigan
Re: Redemption system for points
« Reply #10 on: December 21, 2016, 04:11:22 PM »
Hi, been trying to use this redeemption system.
And i get the fail status to work, with "not enogh credits"

but i can't get the messages in "The full successful command action looks like this:"

It's just empty after i do "!redeem 1"
but it takes the points

ive copy and pasted everything, but still wont work for some reason

Consider me a complete idiot, because the easiest way to do this is to just make !redeem1 !redeem2 etc. the actual commands for the redemption (you can set the min points required on the same screen of the interface under access control), then set the "insufficient points message" as the fail message on the bottom right of the interface, just above the "save and close"/"cancel" buttons. :) Has been flawless and MUCH simpler since this overhaul. LOL

Don't forget to add a sound so you can hear when someone used it!!

E.g. for the !redeem1 command, to
1) Announce someone redeemed something,
2) Save a log of it, so you don't forget!,
3) Check they have appropriate points in their bank,
4) Take the points if they have enough OR Run insufficient message if they don't
Enter similar code in the "message" box:
Code: [Select]
/me Yo, Kerri! @user@ redeemed the "You choose the class/hero!" perk for @cost@ @pointsname@ PogChamp Play 5 games with @target@! @savelog@[E:\!Back Up\DOCUMENTS\WORK\TWITCH\Stream\Tools\Bots\kerribot\redeem\unfulfilled\redeem1.txt,@user@ | @target@ | @unixtime@]