Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: 1/100 chance of something  (Read 2587 times)

0 Members and 1 Guest are viewing this topic.

gamerx365

    Topic Starter


    Adviser
  • Radda Radda!
  • Thanked: 1
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Windows 10
1/100 chance of something
« on: March 19, 2008, 07:28:21 AM »
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
PAUSE

devcom



    Apprentice

    Thanked: 37
    Re: 1/100 chance of something
    « Reply #1 on: March 19, 2008, 08:16:08 AM »
    try
    Code: [Select]
    SET /a rmonster=%random% %%100
    IF %rmonster% equ 5 GOTO rmonsterattck
    Download: Choice.exe

    gamerx365

      Topic Starter


      Adviser
    • Radda Radda!
    • Thanked: 1
      • Yes
      • Yes
    • Experience: Experienced
    • OS: Windows 10
    Re: 1/100 chance of something
    « Reply #2 on: March 19, 2008, 01:06:49 PM »
    well 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 rmonsterattck

    devcom



      Apprentice

      Thanked: 37
      Re: 1/100 chance of something
      « Reply #3 on: March 19, 2008, 02:56:19 PM »
      well 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 ?
      Download: Choice.exe