1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  4. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  5. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  6. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  7. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  8. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] Funny JASS code

Discussion in 'Triggers & Scripts' started by Bribe, Feb 25, 2010.

Thread Status:
Not open for further replies.
  1. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,021
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Code (vJASS):
    function Work takes everything returns nothing
        loop
            exitwhen (hours > 8 + overtime)
            call DoNothing( )
            set hours = hours + 1
        endloop
     
        if DaysWorked = 10 then
            call Payday( )
        endif
     
        set DaysWorked = DaysWorked + 1
    endfunction
     
  2. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    Haha I'd like to call that function a few times. Unemployment ftl.
     
  3. Mooglefrooglian

    Mooglefrooglian

    Joined:
    Nov 28, 2008
    Messages:
    701
    Resources:
    0
    Resources:
    0
    Sadly, you only get paid once. Ever.
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,477
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Syntax error, everything is not a valid type. You need a type before it.

    Is this a global or local or what?
    If it is a local it is a syntax error as there is no hours difined at the start of the function.
    If it is a global your loop will only work the first function call as you never set hours back to 0.

    Does nothing but an empty function call. Just delete it as it has no use in JASS.
     
  5. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    I don't think he gets it.
     
  6. WherewolfTherewolf

    WherewolfTherewolf

    Joined:
    Jul 18, 2008
    Messages:
    2,821
    Resources:
    3
    Models:
    3
    Resources:
    3
    Either that or we don't get his post

    Perhaps Offtopic would fit this better though - anyways that has to be about the best Jass code ever, though it leaks laziness in a few key places unfortunately which if put into the payday formula would cause udg_PocketCash to decrease
     
  7. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Code (vJASS):

    function Work takes effort everything returns nothing
        local integer hours = 0
       
        loop
            exitwhen (hours > 8 + udg_overtime)
            DisplayTextToForce(GetPlayerByName("Boss"), "Today my team has created a timeline and established our resource needs. Tomorrow we plan to revise our timeline and reestablish our resource needs.")
            set hours = hours + 1
        endloop
     
        if udg_DaysWorked = 10 then
            call Payday( )
        endif
     
        set udg_DaysWorked = udg_DaysWorked + 1
    endfunction


    Request fulfilled. Code is not MUI and MPI and stuff.
     
  8. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    ..win.
     
  9. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,477
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    effort is not a valid WC3 type...

    Keep in mind this is a serious board.
     
  10. vAnKaTa_G.G.

    vAnKaTa_G.G.

    Joined:
    Feb 16, 2010
    Messages:
    104
    Resources:
    0
    Resources:
    0
    make it a:
    function Work takes unit returns nothing
    //unit = person
    and everyone's happy :D
    I'm new at scripting but this is just... funny :D .
     
  11. WherewolfTherewolf

    WherewolfTherewolf

    Joined:
    Jul 18, 2008
    Messages:
    2,821
    Resources:
    3
    Models:
    3
    Resources:
    3
    Well if you could get a mod (which may or may not be you, not sure if you have jurisdiction here or not) to move this to Off Topic then that will probably be great and satisfy your desire for seriousness
     
  12. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,659
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    I think I'll just close this..
     
Thread Status:
Not open for further replies.