|
Answer» When working on Eternal Death Slayer Version 2, I thought it would be cool if there is a chance of something you dont expect, so i decided on a 1 out of 100 chance that a monster attacks you when you GO to the lobby, although when i inserted the code, all it did is make the WINDOW close. Here's my code:
Code: [Select]SET /a rmonster=%random% %%100>nul IF %rmonster%=5 GOTO rmonsterattck And then I was wondering maybe its something at the rmonsterattck that was going wrong, so here you go (THOUGH theres not much code here):
Code: [Select]:rmonsterattck CLS ECHO Logged in as %name% - Random Monster ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ECHO º STATS ECHO º Life=%life% Money=%money% Skill=%skill% Armor=%armor% ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ECHO. ECHO PAUSEtry Code: [Select]SET /a rmonster=%random% %%100 IF %rmonster% equ 5 GOTO rmonsterattckwell i ADDED it and it doesnt close the window but i was testing to make sure it would work properly and it wouldn't goto rmonsterattck Code: [Select]SET /a rmonster=%random% %%1 IF %rmonster% lss 0 set rmonster=1 IF %rmonster% equ 1 GOTO rmonsterattckwell when i executed code it try to do Code: [Select]if 0 LSS 0 set rmonster=1so it never set rmonster to 1. try use equ but i think it will mess in code right ?
|