Jump to content


Photo

coroutine.sleep / yield error


    2 replies to this topic

    #1 kylewhat

    kylewhat

      Newbie

    • Members
    • Pip
    • 2 posts

      Posted 04 December 2016 - 06:56 PM

      I copied this script for using silt pouches and can't seem to get it running.    I have tried to replace coroutine.sleep with other ghetto timing functions but it always crashes windower.   Any help or push in the right direction would be appreciated.

       

       

      ERROR:  User Event Error ...(x86)/Windower4//Addons/Gearswap/user_functions.lua:398: stack overflow

       

      _addon.name = 'Silt'
      _addon.command = 'silt'
      
      silt = false
      windower.send_command('unbind !x')
      windower.send_command('bind !x silt Toggle')
      windower.send_command('alias sp lua silt')
      
      
      
      function freemyinv()
          while silt do
              windower.send_command('input /item "Silt Pouch" <me>')
      		coroutine.sleep(1)
          end
      end
      
          
      windower.register_event('addon command', function(command)
          if command == 'Toggle' then
              silt = not silt
              windower.add_to_chat(7, "You are a fucking cheater - "..(silt and "Enabled" or "Disabled"))
              if silt then
                  freemyinv()
              end
          end
      end)
      

       

       



      #2 Kenshi

      Kenshi

        Advanced Member

      • Members
      • PipPipPip
      • 334 posts

        Posted 04 December 2016 - 07:34 PM

        why it is throwing a gearswap error? are you copying this into a gearswap use file? This is an addon and should be in a Silt.lua file into a folder named Silt inside the Addons folder.


        • kylewhat likes this

        #3 kylewhat

        kylewhat

          Newbie

        • Members
        • Pip
        • 2 posts

          Posted 04 December 2016 - 09:34 PM

          It works now!  Thank you






          1 user(s) are reading this topic

          0 members, 1 guests, 0 anonymous users