k i have a questions that ive always wondered, and just now asking!
ok for like the gold trigger its like...you know the substring? where you enter like 4, 29 or somthing like that..How the hell do you figure out what numbers go there and or what the differance in numbers do..
Sub strings
Moderator: Cheaters
-
- Member
- Posts: 86
- Joined: April 7th, 2007, 2:39 am
-
- V.I.P.
- Posts: 332
- Joined: March 4th, 2007, 12:39 am
- Location: United States
Mmk...
You use substring as a way to tell the trigger that that is what you entered, and the numbers are what tells the trigger what to set your gold to.
((Entered chat string), 7, 20)))), so every number at the 7th spot and 20th spot in your message (event) is what it sets your gold to.
Did this help? I tried my best to explain right..
Otherwise Xantan will own it..
edit: the 2 numbers are what the trigger alllows, so 7, 20 allows for a 13 digit number!
edit2: Look at this also, I think it may help!
8, 10)) Equal to 500 - so if the 8th spot is a 5, the 9th spot is a 0, and the 10th spot is a 0, it returns true! (does action)
Code: Select all
gold
Events
Player - Player 1 (Red) types a chat message containing -gold as A substring
Conditions
Actions
Player - Set (Triggering player) Current gold to (Integer((Substring((Entered chat string), 7, 20))))
((Entered chat string), 7, 20)))), so every number at the 7th spot and 20th spot in your message (event) is what it sets your gold to.
Did this help? I tried my best to explain right..
Otherwise Xantan will own it..
edit: the 2 numbers are what the trigger alllows, so 7, 20 allows for a 13 digit number!
edit2: Look at this also, I think it may help!
Code: Select all
gold2
Events
Player - Player 1 (Red) types a chat message containing -gold as A substring
Conditions
(Substring((Entered chat string), 8, 10)) Equal to 500
Actions
Player - Set (Triggering player) Current gold to 500
Doesn't Dekar make the world easier?
"I Wumbo. YOU Wumbo. He she me.. WUMbo. Wumbo; WumboING; WumBOLogy; the study of WUMBO. It's first grade, Spongebob!"
"I'm sorry I doubted your great wisdom Patrick!"
Catch me on Azeroth (U.S. East) - NameSpoofer
namespoofer wrote:Mmk...
You use substring as a way to tell the trigger that that is what you entered, and the numbers are what tells the trigger what to set your gold to.Code: Select all
gold Events Player - Player 1 (Red) types a chat message containing -gold as A substring Conditions Actions Player - Set (Triggering player) Current gold to (Integer((Substring((Entered chat string), 7, 20))))
((Entered chat string), 7, 20)))), so every number at the 7th spot and 20th spot in your message (event) is what it sets your gold to.
So... why doesn't 1, 20 work? :S
-
- V.I.P.
- Posts: 332
- Joined: March 4th, 2007, 12:39 am
- Location: United States
cuz then it will accept '-gold', and we don't want letters.. we want integers!
Doesn't Dekar make the world easier?
"I Wumbo. YOU Wumbo. He she me.. WUMbo. Wumbo; WumboING; WumBOLogy; the study of WUMBO. It's first grade, Spongebob!"
"I'm sorry I doubted your great wisdom Patrick!"
Catch me on Azeroth (U.S. East) - NameSpoofer
-
- Member
- Posts: 86
- Joined: April 7th, 2007, 2:39 am
-
- V.I.P.
- Posts: 332
- Joined: March 4th, 2007, 12:39 am
- Location: United States
that would work fine, if you input say -lvl 500, and the max lvl is only 200, it will set your hero's lvl to 200, cuz it's max! But in your case, the maximum lvl it would accept would be a 17 digit number! And if it was 4, 5, then it would only accept a 2 digit number, aka max lvl possible = 99 through that command!
Doesn't Dekar make the world easier?
"I Wumbo. YOU Wumbo. He she me.. WUMbo. Wumbo; WumboING; WumBOLogy; the study of WUMBO. It's first grade, Spongebob!"
"I'm sorry I doubted your great wisdom Patrick!"
Catch me on Azeroth (U.S. East) - NameSpoofer
-
- Honorary wc3edit.net Traitor
- Posts: 2507
- Joined: February 1st, 2007, 4:11 pm
- Location: NEVADA
for -gold use 6,20
for -lvl use 5,20
this is incase you accidently forget a space (as it does not matter unlike letters)
ie -gold 99999999 will work still and
-gold999 will work still
rather then ONLY just -gold 99999
so substrings... you count all your letters and then forget about the space (but still add 1 as you cannot have a letter for a integer as said before... it will return as 0) for the best possible commands imo
-gold (5)
-lvl (4)
sorry for blabber and usefulnesses I sort of just work up.. lol
for -lvl use 5,20
this is incase you accidently forget a space (as it does not matter unlike letters)
ie -gold 99999999 will work still and
-gold999 will work still
rather then ONLY just -gold 99999
so substrings... you count all your letters and then forget about the space (but still add 1 as you cannot have a letter for a integer as said before... it will return as 0) for the best possible commands imo
-gold (5)
-lvl (4)
sorry for blabber and usefulnesses I sort of just work up.. lol
What're you saying..? I understand the first bit, but the second bit doesn't make any sense at all. lol, or I am just too noob at integers XDXantan wrote:for -gold use 6,20
for -lvl use 5,20
this is incase you accidently forget a space (as it does not matter unlike letters)
ie -gold 99999999 will work still and
-gold999 will work still
rather then ONLY just -gold 99999
so substrings... you count all your letters and then forget about the space (but still add 1 as you cannot have a letter for a integer as said before... it will return as 0) for the best possible commands imo
-gold (5)
-lvl (4)
sorry for blabber and usefulnesses I sort of just work up.. lol
-
- V.I.P.
- Posts: 332
- Joined: March 4th, 2007, 12:39 am
- Location: United States
He's saying that using 6, 20, it will take the integer right after -gold
so.. both will work
-gold 666
-gold666
so.. both will work
-gold 666
-gold666
Doesn't Dekar make the world easier?
"I Wumbo. YOU Wumbo. He she me.. WUMbo. Wumbo; WumboING; WumBOLogy; the study of WUMBO. It's first grade, Spongebob!"
"I'm sorry I doubted your great wisdom Patrick!"
Catch me on Azeroth (U.S. East) - NameSpoofer