Sub strings

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
Joshsta818
Member
Posts: 86
Joined: April 7th, 2007, 2:39 am

Sub strings

Post by Joshsta818 »

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..
Image
WhiteSkidMaul Wars
~Now Gone Superspeed!~
namespoofer
V.I.P.
Posts: 332
Joined: March 4th, 2007, 12:39 am
Location: United States

Post by namespoofer »

Mmk...

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))))
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.. :shock:
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
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)
Image
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
Bartimaeus²

Post by Bartimaeus² »

namespoofer wrote:Mmk...

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))))
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.

So... why doesn't 1, 20 work? :S
namespoofer
V.I.P.
Posts: 332
Joined: March 4th, 2007, 12:39 am
Location: United States

Post by namespoofer »

cuz then it will accept '-gold', and we don't want letters.. we want integers!
Image
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
Bartimaeus²

Post by Bartimaeus² »

namespoofer wrote:cuz then it will accept '-gold', and we don't want letters.. we want integers!
Ahhh, I understand now, lol, -gold (7, 20), it would ignore the first 6 letters (including spaces) but would do whatever 7-20 said. Isn't that about right?
User avatar
Joshsta818
Member
Posts: 86
Joined: April 7th, 2007, 2:39 am

Post by Joshsta818 »

i understand it a little bit more now thanks.. so
-lvl xx = 4, 20 ? but does the 20 number hav to be 20? it could be like 5, but then the max "lvl/digits" wouldnt go as high?
Image
WhiteSkidMaul Wars
~Now Gone Superspeed!~
namespoofer
V.I.P.
Posts: 332
Joined: March 4th, 2007, 12:39 am
Location: United States

Post by namespoofer »

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!
Image
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
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Post by Xantan »

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
Bartimaeus²

Post by Bartimaeus² »

Xantan 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
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 XD
namespoofer
V.I.P.
Posts: 332
Joined: March 4th, 2007, 12:39 am
Location: United States

Post by namespoofer »

He's saying that using 6, 20, it will take the integer right after -gold

so.. both will work

-gold 666
-gold666

:D
Image
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