- Joined
- Nov 3, 2008
- Messages
- 44
SOLVED
Hey, there.
Right now I am playing around with generalizing my command-system. Here is a part of it:
My problem/question is wether you people know a possibility to get the preset "Minerals" replaced by a string, so I can use the Loop-A to define the kind of ressource I want to modify.
The only way to realize that is using a custom script and I'm totally new to it.
If you can post some good tutorials or even such a script, do so please!
Uhm... Nvm, Im doing it this way. *lol*
How to close/mark a thread as solved?
Hey, there.
Right now I am playing around with generalizing my command-system. Here is a part of it:
-
Command = "" <String[10]>
-
Variable - Set Command[1] = "minerals"
-
Variable - Set Command[2] = "vespene"
-
Trigger:
-
Events
-
Game - Player Any Player types a chat message containing "-", matching Partially
-
-
Local Variables
-
A = 0 <Integer>
-
-
Conditions
-
Actions
-
General - For each integer A from 1 to 2 with increment 1, do (Actions)
-
Actions
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
(Substring((Entered chat string), 2, ((Length of Command[A]) + 1))) == Command[A]
-
-
Then
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
Or
-
Conditions
-
A == 1
-
A == 2
-
-
-
-
Then
-
Player - Modify player (Triggering player) Minerals: Set To (Integer((Substring((Entered chat string), ((Length of Command[A]) + 2), (Length of (Entered chat string))))))
-
-
Else
-
-
-
Else
-
-
-
-
-
My problem/question is wether you people know a possibility to get the preset "Minerals" replaced by a string, so I can use the Loop-A to define the kind of ressource I want to modify.
The only way to realize that is using a custom script and I'm totally new to it.
If you can post some good tutorials or even such a script, do so please!

Uhm... Nvm, Im doing it this way. *lol*
-
Trigger:
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
A == 1
-
-
Then
-
Player - Modify player (Triggering player) Minerals: Set To (Integer((Substring((Entered chat string), ((Length of Command[A]) + 2), (Length of (Entered chat string))))))
-
-
Else
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
-
A == 2
-
-
Then
-
Player - Modify player (Triggering player) Vespene: Set To (Integer((Substring((Entered chat string), ((Length of Command[A]) + 2), (Length of (Entered chat string))))))
-
-
Else
-
-
-
-
Last edited: