Author Topic: More advanced Fight command  (Read 2578 times)

0 Members and 1 Guest are viewing this topic.

Sizzles

  • Youngling
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
More advanced Fight command
« on: June 24, 2017, 08:08:29 PM »
So currently i am using the Fight command that is on the DeepBot wiki (http://wiki.deepbot.tv/custom_mini-games#fight) and i want to make the command more advanced. So my idea is to add !accept and !decline commands. If the target accepts the fight happens and if the target declines it doesn't but to add onto that i only want the target to be able to use the !accept and !decline commands. Also if the target doesn't answer the prompted message saying to accept or decline in X amount of time then it will say they didn't respond.

Is this possible and how exactly would i do it?
This is my attempt at it https://pastebin.com/raw/dCa9KCAn

xxxScorpion

  • Youngling
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
  • Twitch Name: xxxScorpion
Re: More advanced Fight command
« Reply #1 on: June 25, 2017, 12:32:19 PM »
My brain cant read all of that at the moment from just waking up but you can put this at the beginning of the command chain.

!fight @target@

@if@[@readfile@[fightgame.txt]||closed||@exec@[0,!fightgameon] @exec@[0,!fighter1] @exec@[0,!fighttarget] @exec@[60,!fighttimer] @exec@[!fighter2msg]||/w @user@ Someone else is currently fighting!]

!fightgameon

@savefile@[fightgame.txt,open]

!fighter1

@savefile@[fighter1.txt,@user@]


!fighttarget

@savefile@[fighttarget.txt,@target@]

!fighttimer

@if@[@readfile@[fighter2.txt]||none||!fightoff||!nothing]

!fightoff

@exec@[0,@savefile@[fighter1.txt,none]]

@exec@[0,@savefile@[fightgame.txt,closed]]

!nothing

(literally does nothing)

!fighter2msg

/w @user@ has challenged you to a fight! To accept enter !fighter2

!fighter2

@if@[@readfile@[fighttarget.txt]||@user@||@savefile@[fighter2.txt,@user@]|/w @user@ You aren't being challenged to a fight!

From here you link to the main fighting game commands.

After the fight has ended just link a final command to close all open slots.


!finalcommand

@exec@[0,@savefile@[fightgame.txt,closed]] @exec@[0,@savefile@[fighter1.txt,none]] @exec@[0,@savefile@[fighter2.txt,none]]

That should more or less do it. Just gotta figure out how to chain it to the current fight game.

Sizzles

  • Youngling
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: More advanced Fight command
« Reply #2 on: June 26, 2017, 02:04:43 PM »
I actually can't get that to work and all the commands that have more than 1 @exec@ in them just do the first @exec@ then post  ]

Here is what i have done...

https://pastebin.com/raw/dCa9KCAn

Sizzles

  • Youngling
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: More advanced Fight command
« Reply #3 on: June 29, 2017, 08:19:02 AM »
If someone could help i would love it. I really want this command to work...

Sizzles

  • Youngling
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: More advanced Fight command
« Reply #4 on: July 06, 2017, 12:25:40 PM »
I figured it out. Thanks for the help.