Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
wylderhoads1809

Help with Computronics chatbox

Question

Posted

I'm trying to pull the event chat_message but am having a strange issue. The event is pulled normally, but it outputs a bunch of information to the screen even without printing it within the program. The code I have is as follows:

local event = require("event")

while true do

local a,b,x,y = event.pull("chat_message")

end

this shouldnt print anything to the screen, however I get the following info with every chat event:GMjEUO6.png

 

how do I prevent this message from showing up every time?

3 answers to this question

Recommended Posts

  • 0
Posted

A: I honestly don't know how to use event.listen. I messed around with it some but couldn't figure it out.

B: That's the whole program and it still prints all the text from the picture anytime it pulls the event.

  • 0
Posted

event.listen works like this.... 

-- your handler
local function doOnEvent(event, ...)
	print( event, ... )
end

-- pass handler to event.listen to be called when there is a 'key' event.
-- It will recieve the event and any other pertinent parameters like which key was pressed.
event.listen( 'key', doOnEvent )

-- Pass event.ignore your previously registered handler to stop it from passing any future event when we're done.
event.ignore( 'key', doOnEvent )

My point is that event.listen( 'someEvent', handler ) will be called even after your program has ended. So, if you were experimenting with it and registered a handler that prints an event

then perhaps that is the result you're seeing printed to the screen. The wiki says that if your program registers a handler and your program calls event.pull, both will get the relevant event.

Hence why your program may still be printing although you're only pulling an event... I hope this helps... If not.. kill it with fire and make a new one :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.