a one trigger calc=wont work?

CaptDeath

New Member
Reaction score
103
i am trying to make a in game calcuator so im asking you guys weres my mistake?
Trigger:
  • One trigger Calc
    • Events
      • Player - Player 1 (Red) types a chat message containing * as A substring
      • Player - Player 1 (Red) types a chat message containing + as A substring
      • Player - Player 1 (Red) types a chat message containing \ as A substring
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 1 (Red) types a chat message containing = as An exact match
      • Player - Player 1 (Red) types a chat message containing # as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring(*, 1, 1)) Equal to *
        • Then - Actions
          • Set Calc[(Player number of (Triggering player))] = (Calc[(Player number of (Triggering player))] x (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string)))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring(+, 1, 1)) Equal to +
        • Then - Actions
          • Set Calc[(Player number of (Triggering player))] = (Calc[(Player number of (Triggering player))] + (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string)))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring(\, 1, 1)) Equal to \
        • Then - Actions
          • Set Calc[(Player number of (Triggering player))] = (Calc[(Player number of (Triggering player))] / (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string)))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring(-, 1, 1)) Equal to -
        • Then - Actions
          • Set Calc[(Player number of (Triggering player))] = (Calc[(Player number of (Triggering player))] - (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string)))))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to =
        • Then - Actions
          • Game - Display to (All players) the text: (String(Calc[(Player number of (Triggering player))]))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring(#, 1, 1)) Equal to #
        • Then - Actions
          • Set Calc[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string))))))
        • Else - Actions
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> (Substring(*, 1, 1)) Equal to *

Well, you should probably test some part of "Entered chat string"...
(Same for the other operations)
 

CaptDeath

New Member
Reaction score
103
if/then/else+substrings = fail :(

:banghead:
so i am trying to make a one trigger calculator the issue is it takes a sub string
ether
-
+
\
*
#(sets the current # in the variable)
and it stores w/e after for the function
Removed trigger for the person im making it for asked me too o.0
if you need it i can email you the finished version once im there lol
even if i say
-10
i get 6 msgs cmd accepted
 

Metaldrummer

New Member
Reaction score
11
It's the conditions. The problem is that you're comparing <command> to <command> rather than what they typed in to <command>.

Change the (for all six of them):

Trigger:
  • If - Conditions
    • (Substring(&lt;symbol&gt;, 1, 1)) Equal to &lt;symbol&gt;

to

Trigger:
  • If - Conditions
    • (Substring((Entered chat string), 1, 1)) Equal to &lt;symbol&gt;
 

Curo

Why am I still playing this game...?
Reaction score
109
The above poster is correct. What you are doing is checking if * is equal to *. And of course, * will always be *. You need to reference the entered chat string.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top