Queries

General discussion of Warcraft 3. Threads may may be posted here if they don't fit into the other sections.

Moderator: Cheaters

naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Queries

Post by naturesfury »

pretty sure the last number isnt counted in JASS (idk anything about GUI tho)
and you do realize the last thread was like 2 weeks ago o.o
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Re: Queries

Post by owner123 »

o.o Did you write that? It's pretty awesome.
User avatar
Risugami
Senior Member
Posts: 134
Joined: September 25th, 2011, 1:15 pm
Title: Slacking

Re: Queries

Post by Risugami »

Well, in GUI, the first character is 1. and in JASS, the first character is 0. So for an example:

GUI: Substring(s, 1, 5)

JASS: Substring(s, 0, 4)

It selects the exact thing thou
Image Image
(Made by: Risugami) | Risugami's Signature Workshop

"As a young boy, I was taught in high school that hacking was cool. - Kevin Mitnick"
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Queries

Post by naturesfury »

yea o.o but SubString("hellothisisastring",0,5)
would select "hello"
User avatar
Risugami
Senior Member
Posts: 134
Joined: September 25th, 2011, 1:15 pm
Title: Slacking

Re: Queries

Post by Risugami »

Well as far as I know it would select hellot. Since JJ's CP uses this. (Correct me if I'm wrong though)

Example:

Code: Select all

if SubString(s2s,0,6)=="-gold "then
0 - 6 will be then the next character after the space.
Image Image
(Made by: Risugami) | Risugami's Signature Workshop

"As a young boy, I was taught in high school that hacking was cool. - Kevin Mitnick"
Apple
Forum Staff
Posts: 1470
Joined: November 3rd, 2010, 10:48 am
Title: Best Player
Location: Singapore

Re: Queries

Post by Apple »

Risugami wrote:Uses of Strings :
In my opinion, the use of strings is by far the most interesting and clever and most interactive way to let players manipulate and use the game. Anything, '-ar' and '-apen' to '-name' are all examples of using strings. Even when you type a simple message to a friend, you are using strings to communicate and send a message. Strings could be used for more advanced things, like tax and such. In games like SotDRP, a popular battle.net role playing game, the entire game is operated through commands like 'size ###' and 'tint ###' to mod the units in the game.

Uses of Substrings :
Let's face it. Without substrings, I don't think any String Related systems and snippets would be possible. Substrings allow us to look at specific things in the string, instead of the whole thing. When using '-name', we use substrings to only look at what comes after the '-name' instead of setting the players name to '-name Jimmy'. In '-apem' we make sure that the string begins with '-apem' instead of the host saying "No -Apem'. Without substrings, the host could accidently trigger a mode, or someone would have a stupid name. I mean, who wants to be named '-name Jimmy'?

How to use Substrings
Substrings may seem confusing at first. For a long time, I did not know how to use Substrings, and I was afraid to ask for help. Being such a big helper, I did not want to look stupid. SELF REVELATION FOR THE WIN. But, anyway, after a bit, I learned to use them from testing and learning. Now, look, this is how substrings work.
Image
In this example, 'Substring (2,5)' is 'RUNT'. How do I find this? Look at the small (red) numbers before each letter or symbol. That is the letter's substring integer, a phrase I will use in this tutorial. Now, the substring's integers are the '2,5' in the string. '2' is the starting point, and '5' is the last letter in the integer. This goes for anything. To see if you understand it, answer this question. When you think you know what it is, click the spoiler.

Q: What is 'Substring 4,6' in 'Thanksgiving Turkey'?
Spoiler:
A: 'nks'
Substrings in JASS
If you want to find Substrings in JASS, they are almost the same. The thing is, in JASS, the first character is 0. See, the thing is, in GUI, it is made to be easy for people to understand without learning a language. So, 1 seams like a better place to start than 0. But, in JASS, there is no reason to make it really easy, so it starts at 0. So, just find the regular string numbers, and subtract one. So, SubString(2,6) in GUI is SubString(1,5) in JASS.

Code: Select all

 G R U N T ' S
0 1 2 3 4 5 6 7
That was a really nice tutorial about strings, thanks ^^
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Queries

Post by naturesfury »

erm...it checks to see if the substring is "-gold " plus, if the last one was counted....you couldn't select just one character o.o
SubString("wheee",0,1)="w"
SubStringBJ("wheee",1,1)="w"
the bj just subtracts one from the 2nd argument so they are essentially equivalent
User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

Re: Queries

Post by Nuuby »

So should we have a guide on all commonly used natives or are some just hard to understand. Or at least those used in the common cheat packs around here.
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: Queries

Post by naturesfury »

xD go for it!
maybe add the GUI alternatives too ^^ just to help ppl learn

gonna be tedious though o.o
Apple
Forum Staff
Posts: 1470
Joined: November 3rd, 2010, 10:48 am
Title: Best Player
Location: Singapore

Re: Queries

Post by Apple »

Nuuby wrote:So should we have a guide on all commonly used natives or are some just hard to understand. Or at least those used in the common cheat packs around here.
Yeah we should ^^
That's a good idea!
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.