Author Topic: Scorpions Custom Command Q&A Compendium  (Read 2600 times)

0 Members and 1 Guest are viewing this topic.

xxxScorpion

  • Youngling
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xxxScorpion
Scorpions Custom Command Q&A Compendium
« on: November 18, 2015, 05:10:44 PM »
Trying to get better at custom commands i
i decided to make this dedicated thread where I'd post all my questions as they come and quote the answers/examples given by the kind people here in case others may ever have use for it. Or just solely for my reference, whatever.

Questions:

1. Can remote obs toggle more than one source without command chaining? Ex. Playing multiple gifts simultaneously.



2. Can points be given based on the amount or a chosen percentage of viewers watching? Ex.


3. Can custom commands be restricted to a single user aside from putting said user in a personal VIP rank? Ex. User donates to channel. Personal command is given for remote obs use.


4. Can points removed from users through commands be put into a pool to award to another/other users.



ExpertsOnline

  • Creator
  • Councilor
  • *****
  • Posts: 2656
  • Karma: +289/-24
    • View Profile
  • Twitch Name: expertsonline
Re: Scorpions Custom Command Q&A Compendium
« Reply #1 on: November 18, 2015, 05:27:02 PM »
1. No - you will need to chain commands.

2. The default timer is a fixed amount, however the golden buttons on the chat tab can be used to give bonus points to watching viewers. You could also create a command which does "!add @viewers@ all" to add points equal to the number of viewers to everyone.

3. You could do this using the @if@ command. @if@[@user@||expertsonline||This is only for experts!||]

4. Not easily. You will need to use the @calc@ command and a combination of @readfile@ and @savefile@ to maintain this balance in a text file.

xxxScorpion

  • Youngling
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xxxScorpion
Re: Scorpions Custom Command Q&A Compendium
« Reply #2 on: November 18, 2015, 05:41:28 PM »
Awesome, thanks for the help. Its a bit daunting starting out trying to use complex commands so its greatly appreciated.

xxxScorpion

  • Youngling
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xxxScorpion
Re: Scorpions Custom Command Q&A Compendium
« Reply #3 on: November 19, 2015, 12:39:53 AM »
Is there a format to using !add ____ _________ and !remove _____ _________ in the same command?

When I run, !remove @readfile@[custom logs/steal.txt] @readfile@[custom logs/target.txt] !add @readfile@[custom logs/steal.txt] @readfile@[custom logs/user.txt] only the action is done. I'm just trying to both remove points from a target and add points to a user in one go without spamming chat with a million chain commands.

Here's the entire Command chain.

1. @savefile@[steal.txt,@rand@[1,50]] @savefile@[user.txt,@user@]@user@ is fooling around with @target@'s piggybank!@savefile@[target.txt,@target@]

2. @user@ made off with @readfile@[custom logs/steal.txt] of @readfile@[custom logs/target.txt]'s coins!

3. !remove @readfile@[custom logs/steal.txt] @readfile@[custom logs/target.txt]

and how I want Command 3 to operate...

!remove @readfile@[custom logs/steal.txt] @readfile@[custom logs/target.txt],!add @readfile@[custom logs/steal.txt] @readfile@[custom logs/user.txt]


Or preferably I'd just add everything from Command 3 into the second command if possible.

Thanks.

ExpertsOnline

  • Creator
  • Councilor
  • *****
  • Posts: 2656
  • Karma: +289/-24
    • View Profile
  • Twitch Name: expertsonline
Re: Scorpions Custom Command Q&A Compendium
« Reply #4 on: November 19, 2015, 03:33:10 PM »
Well you don't really need to use files for this, if it is just one user. Also you should check if the user has sufficient points to steal. Below is what i made. You can make it more complex by using @rand@ to create a chance for failing and losing your own coins.

Command 1: This checks if the user has more than 50 points, if not limits the amount you can steal to his max points.
Name: !steal
Message: !steal2 @target@[1] @if@[>||@lookupinfo@[@points@,@target@[1]]||50||50||@lookupinfo@[@points@,@target@[1]]]
Run As: User (Elevated)
Chain: None

Command 2: This checks if the points value is valid. i.e. correct user name entered and user has 1 or more points.
Name: !steal2
Access: Streamer/Bot
Run As: User (Elevated)
Message: @if@[>||@target@[2]||0||!steal3 @target@[1] @rand@[1,@target@[2]]||@user@ could not find @target@[1] piggybank.]
Chain: None

Command 3: This is the initial message.
Name: !steal3
Access: Streamer/Bot
Run As: User (Elevated)
Message: @user@ is fooling around with @target@[1]'s piggybank!
Chain: !steal4 @target@[1] @target@[2]
Chain Duration: 1 second
Chain Access: Admin (checkbox)

Command 4: Success message.
Name: !steal4
Access: Streamer/Bot
Message: @user@ made off with @target@[2] of @target@[1]'s coins!@editpoints@[@user@|@target@[2]]@editpoints@[@target@[1]|-@target@[2]]
Chain: None



xxxScorpion

  • Youngling
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xxxScorpion
Re: Scorpions Custom Command Q&A Compendium
« Reply #5 on: November 20, 2015, 12:03:52 AM »
Thanks! A bit mind blowing for me as is but slowly catching on.

New question.

I've made a command chain for a lottery drawing. If the user fails to win the lottery goes up by 25 via @savefile@ and @readfile@ so the number can be maintained and displayed on screen. Everythings perfect except when the lottery hits 1000 another failed attempt wipes any information in the text file leaving a blank display. When used again if failed, 25 points are added back to the lottery and goes up from there. Is there an issue on my end or something with @calc@?

Lottery won command chain:

!lottery
@if@[>=||@rand@[0,100]||100||!lottery2||!lottery4]

!lottery2
@editpoints@[@user@|@readfile@[custom logs/lottery/jackpot.txt]] You've won the Jackpot of @readfile@[custom logs/lottery/jackpot.txt]! You now have @points@ coins!
Chain: !lottery3

!lottery3
@savefile@[lottery/jackpot.txt,500] The Jackpot is now 500.

Lottery lost command chain:

!lottery
@if@[>=||@rand@[0,100]||100||!lottery2||!lottery4]

!lottery4
@savefile@[lottery/jackpot.txt,@calcpost@[+,25,@readfile@[custom logs/lottery/jackpot.txt]]]!lottery5

!lottery5
Unfortunately you've lost. The Jackpot is now @readfile@[custom logs/lottery/jackpot.txt]!

Once again, the command chain on both sides works fantastically however once a the 1000 threshold it seems to reset.

**just tested with

@savefile@[lottery/1000.txt,@calcpost@[+,25,@readfile@[custom logs/lottery/1000.txt]]]

and a value of 1,025 displayed but once entered again reset to nothing.