[JASS] bj?!

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
haxorico
Super Moderator
Posts: 3198
Joined: February 24th, 2009, 1:31 pm
Location: JEW LAND
Been thanked: 1 time

[JASS] bj?!

Post by haxorico »

whats bj in jasscraft? i see alot of commands on the native list with bj and without bj like

SubString
SubStringBJ
whats the diffrence?
Image
Spoiler:
(02:24:09)

Code: Select all

ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).

Code: Select all


(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac: 

Code: Select all

(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code: Select all

(15:42:51) Lanaya: can i suck , . . .

Code: Select all

(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code: Select all

GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code: Select all

(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).

Code: Select all

(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?
User avatar
itsonlyaname
Senior Member
Posts: 195
Joined: February 13th, 2008, 5:30 pm

Re: [JASS] bj?!

Post by itsonlyaname »

BJ means the command is not a native function, but actualy it's own function.
example: SetHeroLevelBJ and SetHeroLvl



SetHeroLevelBJ:

Code: Select all

function SetHeroLevelBJ takes unit whichHero, integer newLevel, boolean showEyeCandy returns nothing
    local integer oldLevel = GetHeroLevel(whichHero)
 
    if (newLevel > oldLevel) then
        call SetHeroLevel(whichHero, newLevel, showEyeCandy)
    elseif (newLevel < oldLevel) then
        call UnitStripHeroLevel(whichHero, oldLevel - newLevel)
    else
        // No change in level - ignore the request.
    endif
endfunction
Meaning, with SetHeroLevelBJ u can add or substract lvls, while SetHeroLevel is only able to add lvls (because u need UnitStripHeroLevel to substract levels)

So, basicly, commands with BJ have a hidden function, which usualy makes it more usefull.
Altough, sometimes the BJ command uses unneeded code, which would make the trigger slower then it needs to be (like, there is no need to use SetHeroLevelBJ and run the entire block of code everytime, if you aren't going to substract levels with that trigger.)
Sevion
Junior Member
Posts: 44
Joined: April 12th, 2007, 2:43 am
Location: STALKER!!!

Re: [JASS] bj?!

Post by Sevion »

The difference between SubString and SubStringBJ is:

Code: Select all

function SubStringBJ takes string source, integer start, integer end returns string
    return SubString(source, start-1, end)
endfunction
SubStringBJ starts one character before because in GUI (where SubStringBJ is used), if you wanted to select something from....

Code: Select all

string Alphabet = abcdefghijklmnopqrstuvwxyz
And the characters you want are abcd, you would put in SubStringBJ(Alphabet, 1, 4) and it would do:

Code: Select all

SubString(Alphabet, 0, 4)
Here's why, with SubStringBJ, you choose the first integer as which numbered character you want to start at. So, 1 corresponds to "a", 2 to "b", 3 to "c" etc etc. SubString, however, is set between letters. So 0 would correspond to the space between "" (there is nothing before "a") and "a" and if you wanted to select only "a", you'd put in 0, 1.

|a|b|c|d|

Each | is a spot in SubString starting from 0. If you wanted to select abc, 0, 3. ab? 0, 2. etc etc etc.
"Sticks and stones may break my bones, but words will never hurt me!" Ouch! MY ARM!! YOU BROKE MY ARM!!