Why do function callbacks do this weird thing?
Why does this work:
def testfn():
pass
player.on_chat("tfn", testfn)
But then if I do this below...
def testfn2():
testfn()
Suddenly the callback doesn't work in line 3 above and we get this message:
types not compatible(_:number,_:number,_:number)=>void and () => any
I sincerely hope I'm doing something stupid here. However, if I get rid of the callback the testfn() call will work. Bizarre!
Many thanks
Pete....
0
-
Well, I admit the on chat events are a bit exasperating, and I was able to search this one out a bit with you for some coding exploration! I hope this helps. (Note: This is MakeCode Python)
0
Please sign in to leave a comment.
Comments
1 comment