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,375
    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:
    26,131
    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:
    26,131
    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,793
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    I think I'll just close this..
     
Thread Status:
Not open for further replies.