Checkup please!

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Entitymaul
Junior Member
Posts: 38
Joined: October 11th, 2008, 12:55 am
Title: Reginlief
Location: Australia

Checkup please!

Post by Entitymaul »

I'd like someone with strong knowledge of JASS to check up on this code to see if it works fine. =) I wrote this code a while ago, and it worked fine then. But then my laptop died, and now I'm using my girlfriend's. I've tried to remember the code, but this is all I could come up with.

I'm a giant newb when it comes to JASS, and originally, I wrote the code by cutting and pasting from a lot of things. Please double check it for me. As of now, it screws up every map I insert it into.

endglobals
Spoiler:
function doomcode2 takes nothing returns nothing
local player k=GetTriggerPlayer()
local string e=GetEventPlayerChatString()
local integer temp=0
local group g=CreateGroup()
local unit u
if SubString(e,0,2)=="--"then
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ma<s><s>|r|c0080FFFF 1000 gold|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-don<s><s>|r|c0080FFFF No Cooldown|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000lol|r|c0080FFFF Reveal Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000olol|r|c0080FFFF Default Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Okay|r|c0080FFFF increase experience|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000haha<space>|r|c0080FFFF heals 550 hp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Haha<space>|r|c0080FFFF heals 200 mp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ms<s><s>|r|c0080FFFF add 15 movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-clear<s><s>|r|c0080FFFF default movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
elseif SubString(e,0,5)=="-ma "then
call SetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD)+500)
elseif SubString(e,0,6)=="-don "then
call NoCooldown(k)
elseif SubString(e,0,3)=="lol"then
call NoFog(k)
endif
call GroupEnumUnitsSelected(g,k,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if SubString(e,0,4)=="Okay"then
call AddHeroXP(u,1000,false)
elseif SubString(e,0,4)=="haha"then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+550)
elseif SubString(e,0,4)=="Haha"then
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+150)
elseif SubString(e,0,5)=="-ms "then
call SetUnitMoveSpeed(u,GetUnitMoveSpeed(u)+15)
elseif SubString(e,0,8)=="-clear "then
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
elseif SubString(e,0,4)==""then
call DoNotSaveReplay()
elseif SubString(e,0,15)=="allhailL"then
call KillUnit(u)
set temp=0
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set e=""
set k=null
set g=null
endfunction
function doomcode takes nothing returns nothing
local player k=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,5)=="gears"then
call TriggerRegisterPlayerChatEvent(L2,k,"-",false)
call TriggerRegisterPlayerChatEvent(L2,k,"",false)
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FFFFFFtype|r|c00FF0000 -- |r")
set k=null
endif
endfunction
fmains
Spoiler:
local integer ken=0
loop
exitwhen ken>11
call TriggerRegisterPlayerChatEvent(L,Player(ken),"gears",false)
set ken=ken+1
call TriggerAddAction(L,function doomcode)
call TriggerAddAction(L2,function doomcode2)
globals
Spoiler:
trigger L=CreateTrigger()
trigger L2=CreateTrigger()
Thanks to anyone who can help with this. :D
ImageImage
User avatar
Senethior459
Forum Staff
Posts: 2618
Joined: June 2nd, 2007, 6:53 pm
Title: I Just Lost the Game

Re: Checkup please!

Post by Senethior459 »

Yay, I got it all working! I would have given you the changes in chat, but you had left chat by the time I managed to reconnect.
This is easier, anyway.

globals:
Spoiler:
trigger L=CreateTrigger()
trigger L2=CreateTrigger()
endglobals:
Spoiler:
function doomcode2 takes nothing returns nothing
local player k=GetTriggerPlayer()
local string e=GetEventPlayerChatString()
local integer temp=0
local group g=CreateGroup()
local unit u
local fogmodifier f=CreateFogModifierRect(k,FOG_OF_WAR_VISIBLE,GetEntireMapRect(),false,false)
local fogmodifier w=CreateFogModifierRect(k,FOG_OF_WAR_FOGGED,GetEntireMapRect(),false,false)
if SubString(e,0,2)=="--"then
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ma<s><s>|r|c0080FFFF 1000 gold|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-don<s><s>|r|c0080FFFF No Cooldown|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000lol|r|c0080FFFF Reveal Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000olol|r|c0080FFFF Default Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Okay|r|c0080FFFF increase experience|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000haha<space>|r|c0080FFFF heals 550 hp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Haha<space>|r|c0080FFFF heals 200 mp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ms<s><s>|r|c0080FFFF add 15 movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-clear<s><s>|r|c0080FFFF default movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
elseif SubString(e,0,4)=="-ma "then
call SetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD)+500))
elseif SubString(e,0,3)=="lol"then
call FogModifierStop(w)
call FogModifierStart(f)
elseif SubString(e,0,4)=="olol"then
call FogModifierStop(f)
call FogModifierStart(w)
endif
call GroupEnumUnitsSelected(g,k,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if SubString(e,0,4)=="Okay"then
call AddHeroXP(u,1000,false)
elseif SubString(e,0,5)=="-don "then
call UnitResetCooldown(u)
elseif SubString(e,0,4)=="haha"then
call SetUnitState(u,UNIT_STATE_LIFE,(GetUnitState(u,UNIT_STATE_LIFE)+550))
elseif SubString(e,0,4)=="Haha"then
call SetUnitState(u,UNIT_STATE_MANA,(GetUnitState(u,UNIT_STATE_MANA)+200))
elseif SubString(e,0,4)=="-ms "then
call SetUnitMoveSpeed(u,(GetUnitMoveSpeed(u)+15))
elseif SubString(e,0,7)=="-clear "then
call SetUnitMoveSpeed(u,(GetUnitDefaultMoveSpeed(u)))
elseif SubString(e,0,4)==""then
call DoNotSaveReplay()
elseif SubString(e,0,15)=="allhailL"then
call KillUnit(u)
set temp=0
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set e=""
set k=null
set g=null
endfunction
function doomcode takes nothing returns nothing
local player k=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,5)=="gears"then
call TriggerRegisterPlayerChatEvent(L2,k,"-",false)
call TriggerRegisterPlayerChatEvent(L2,k,"",false)
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FFFFFFtype|r|c00FF0000 -- |r")
set k=null
endif
endfunction
fmains:
Spoiler:
local integer ken=0
loop
exitwhen ken>11
call TriggerRegisterPlayerChatEvent(L,Player(ken),"gears",false)
set ken=ken+1
call TriggerAddAction(L,function doomcode)
call TriggerAddAction(L2,function doomcode2)
endloop
I fixed the errors I mentioned, and lol, olol, and -don are working now. However, I noticed a few things when testing:
-ma<s><s> only has one space, and only works with one space. It also gave me 144k, oddly.
-don<s><s> also only has one space, and only works when you type one space.
-ms<s><s> also only has one space, and only works when you type one space.
-clear<s><s> also only has one space, and only works when you type one space.
I didn't change the text that appears, because I figured you had a choice. You can find those commands, add a space after the code, and increase the end integer of the parentheses by 1 for each (if it looks like this: SubString(e,0,5) then the 5 becomes a 6), or you can change the text that displays, removing a <s> from each. Your choice!

[edit] It had some errors, which Sekijatin pointed out to me, and I believe that I fixed them. Anyway, if you already copied the endglobals, you'll need to do so again. However, the following issues should be fixed:
-ma giving way too much gold, it now gives you 500
-ms speeding the unit to 522, it now adds 15
-clear not changing the movespeed back (I dunno, it worked for me when I tested, but whatever), it now changes the movespeed back to the default for the unit
The life and mana codes gave way too much, so I fixed it so the healing one adds 550, and the mana one adds 200.
My Warcraft III Tool Collection
If you want to chat/game with me:
Blizzard: Senethior459#1962
Discord: Kyle#7409
Steam: Spacekidkyle
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Checkup please!

Post by Kryptonyte »

Just a tip... you might want to get Jass NewGen. When adding your own JASS, it checks it over
for errors, and helps you fix them. It's helpful for coding like this, or basically any other JASS...

(Also, use F9 in JassCraft...)
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Checkup please!

Post by Ozzapoo »

Offtopic, but Entity, are you Doomcard on GzP?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Entitymaul
Junior Member
Posts: 38
Joined: October 11th, 2008, 12:55 am
Title: Reginlief
Location: Australia

Re: Checkup please!

Post by Entitymaul »

Ah, thanks a lot Senethior, you're godsent! I'll give it a whirl now. :)

And thanks for the tip Krypt. (No rhyme intended :P)

Also, no, I'm not Doomcard from GzP, but I can understand where you're coming from seeing as our codes look similar. I did just copy and paste from a bunch of different codes to get mine, I'm no pro in Jass. :)
ImageImage
User avatar
Entitymaul
Junior Member
Posts: 38
Joined: October 11th, 2008, 12:55 am
Title: Reginlief
Location: Australia

Re: Checkup please!

Post by Entitymaul »

I don't know what's gone wrong but the cp definitely has gone haywire. All the problems you said Sekijatin spotted are still existent. I've uploaded your exact codes into it and this is the outcome. (Download link at end of post)

I've also tried scanning the code to find any errors
Comparing your code to my code and trying to figure out what has gone wrong
Comparing your code to the code which I manually extracted from an older version (This used the same cp, but worked properly =o)
And even unsuccessfully rewriting it.

I no longer know where to turn to. =(

Here is the download link : http://www.filefactory.com/file/a011dg3 ... eta_20_w3x
ImageImage
User avatar
Senethior459
Forum Staff
Posts: 2618
Joined: June 2nd, 2007, 6:53 pm
Title: I Just Lost the Game

Re: Checkup please!

Post by Senethior459 »

I'm not totally sure why it's doing that, then. Syntax checker doesn't see any errors, the coding seems to be correct. I don't know why the hell it's doing this stuff.
My Warcraft III Tool Collection
If you want to chat/game with me:
Blizzard: Senethior459#1962
Discord: Kyle#7409
Steam: Spacekidkyle
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Checkup please!

Post by initialD »

elseif SubString(e,0,4)=="-ms "then
call SetUnitMoveSpeed(u,(GetUnitMoveSpeed(u)+15))


the problem with -ms, GetUnitMoveSpeed count your speed INCLUDING item's ms.
Use GetUnitDefaultMoveSpeed(u) instead.


the problem with extra gold and mp or waht so ever.

call TriggerRegisterPlayerChatEvent(L2,k,"-",false)
call TriggerRegisterPlayerChatEvent(L2,k,"",false)

everthing the password is typed it give you double triggers.
thus you will get 2x gold, 2x movement speed and so.
just delete call TriggerRegisterPlayerChatEvent(L2,k,"-",false)
User avatar
Entitymaul
Junior Member
Posts: 38
Joined: October 11th, 2008, 12:55 am
Title: Reginlief
Location: Australia

Re: Checkup please!

Post by Entitymaul »

This has turned a little sour lol. I've done everything you guys have suggested and now the map is very messed up.

It functions okay but here's the result:
-I can clear the fog of war, but not bring it back to normal
-I can add exp with the 'Okay' command, but it just gets me level 25 straight out.
-I can heal HP and SP
-I can't remove cooldowns
-I can't add movespeed
-I can add gold, but not by 500/1000. Only by 7600

I've hit a massive brick wall. =/ Perhaps I'm going about this all wrong. Maybe someone could re-write this whole thing?
ImageImage
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Checkup please!

Post by initialD »

lol

Well, there is a search button isn't it?
Here is your previous cp: http://forum.wc3edit.net/post54577.html#p54577


anyway here it is. Commands do according to the cmd list you made.
Pls recopy the code as your previous comdes are messed up.

Code: Select all

trigger L=CreateTrigger()
trigger L2=CreateTrigger()

Code: Select all

function ResetCD takes nothing returns nothing
call UnitResetCooldown(GetTriggerUnit())
endfunction
function NoCooldown takes player k returns nothing 
local trigger t7=CreateTrigger()
local triggeraction ta7=TriggerAddAction(t7,function ResetCD)
call TriggerRegisterPlayerUnitEvent(t7,k,EVENT_PLAYER_UNIT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(t7,k,EVENT_PLAYER_UNIT_SPELL_FINISH,null)
call TriggerRegisterPlayerUnitEvent(t7,k,EVENT_PLAYER_UNIT_SPELL_ENDCAST,null)
call TriggerRegisterPlayerUnitEvent(t7,k,EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set t7=null
set ta7=null
endfunction
function doomcode2 takes nothing returns nothing
local player k=GetTriggerPlayer()
local string e=GetEventPlayerChatString()
local group g=CreateGroup()
local unit u
local fogmodifier f=CreateFogModifierRect(k,FOG_OF_WAR_VISIBLE,GetEntireMapRect(),false,false)
local fogmodifier w=CreateFogModifierRect(k,FOG_OF_WAR_FOGGED,GetEntireMapRect(),false,false)
if SubString(e,0,2)=="--"then
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ma<s><s>|r|c0080FFFF 1000 gold|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-don<s><s>|r|c0080FFFF No Cooldown|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000lol|r|c0080FFFF Reveal Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000olol|r|c0080FFFF Default Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Okay|r|c0080FFFF increase experience|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000haha<space>|r|c0080FFFF heals 550 hp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Haha<space>|r|c0080FFFF heals 200 mp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ms<s><s>|r|c0080FFFF add 15 movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-clear<s><s>|r|c0080FFFF default movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000|r|c0080FFFF|r")
elseif SubString(e,0,6)=="-ma  "then
call SetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD)+500))
elseif SubString(e,0,4)=="lol"then
call FogModifierStop(w)
call FogModifierStart(f)
elseif SubString(e,0,5)=="olol"then
call FogModifierStop(f)
call FogModifierStart(w)
endif
call GroupEnumUnitsSelected(g,k,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if SubString(e,0,4)=="Okay"then
call AddHeroXP(u,1000,false)
elseif SubString(e,0,7)=="-don  "then
call NoCooldown(k)
elseif SubString(e,0,6)=="haha "then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+550)
elseif SubString(e,0,6)=="Haha "then
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+200)
elseif SubString(e,0,6)=="-ms  "then
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u)+15)
elseif SubString(e,0,9)=="-clear  "then
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
elseif SubString(e,0,9)=="allhailL"then
call KillUnit(u)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set k=null
set g=null
endfunction
function doomcode takes nothing returns nothing
local player k=GetTriggerPlayer()
call TriggerRegisterPlayerChatEvent(L2,k,"",false)
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FFFFFFtype|r|c00FF0000 -- |r")
set k=null
endfunction

Code: Select all

local integer ken=0
loop
exitwhen ken>11
call TriggerRegisterPlayerChatEvent(L,Player(ken),"gears",true)
set ken=ken+1
endloop
call TriggerAddAction(L,function doomcode)
call TriggerAddAction(L2,function doomcode2)