Notifications
Clear all

[Closed] My script doesn't update after making new changes

I am still working on how to resolve my dilemma with catching mouse events, and I found a topic here on CGTalk that might work with a little tweaking. The original idea was for helping someone fix the right mouse click bug by adding a timer and a dotNetClass Control. I then took this idea and just added an additional timer which adds a timer event that controls the amount of times the mouse position gets recorded per second.

I tried testing this for the first time and there was an error in my script, which had to do with not defining the dotNetClass control as a string. However, after fixing the error and running the script again, it keeps on running the original script, because I am still receiving the same exact error. :banghead::banghead: Here is my code that I came up with…


  try 
 	destroyDialog FacadeCutTool
 catch
 	
 rollout FacadeCutTool "Untitled" width:208 height:48
 (
 	timer tick_tock interval:100 active:true
 	timer mouseControl interval:80 active:true
 	local dnc_control, mouseButtonStates, lButton, mButton, rButton
 	
 	button vert_split "Button" pos:[8,8] width:32 height:32
 	button horiz_split "Button" pos:[40,8] width:32 height:32
 	button vert_multiSplit "Button" pos:[72,8] width:32 height:32
 	button horiz_multiSplit "Button" pos:[104,8] width:32 height:32
 	button absolute "Button" pos:[136,8] width:32 height:32
 	button floating "Button" pos:[168,8] width:32 height:32
 	on FacadeCutTool open  do
 	(
 		dnc_Control = dotNetClass "Control"  <--- This was where the error occurred originally. I originally had dnc_Control = dotNetClass Control. I forgot to surrond Control in quotes, but as you can see, I had fixed it.
 		mouseButtons = dnc_control.MouseButtons
 		lButton = mouseButtons.Left.value__
 		mButton = mouseButtons.Middle.value__
 		rButton = mouseButtons.Right.value__
 	)
 	on FacadeCutTool close  do
 	(
 		print "Closing dialog"
 	)
 	on vert_split pressed  do
 	(
 	
 	)
 	on horiz_split pressed  do
 	(
 	
 	)
 	on vert_multiSplit pressed  do
 	(
 	
 	)
 	on horiz_multiSplit pressed  do
 	(
 	
 	)
 	on absolute pressed  do
 	(
 	
 	)
 	on floating pressed  do
 	(
 	
 	)
 	on tick_tock tick do 
 	(
 		print "Calling tick_tock"
 		mouseButtonStates = dnc_control.MouseButtons.value__
 		theButtonStr = ""
 		if (dotnet.CompareEnums mouseButtonStates lButton) do 
 		( 
 			print "The left mouse was pressed"
 		)
 -- 		if (dotnet.CompareEnums mouseButtonStates mButton) do 
 -- 		( 
 -- 			print
 -- 		)
 		if (dotnet.CompareEnums mouseButtonStates rButton) do 
 		(
 			print "The right mouse was pressed"
 			#abort
 		)
 		--lbl_button.text = "Button: " + theButtonStr
 	)
 	on mouseControl tick do
 	(
 		print mouse.pos as string
 	)
 )
 
 createDialog FacadeCutTool
  
2 Replies

there is a bug in your rollout definiton, so it never gets fully defined.
you rollout fails to “compile” so to speak
so when you call createDialog , the previously “compiled” version gets used.

try adding

 
FacadeCutTool=undefined

at line 1

Mambo4,
I actually caught what the problem was to my script. As a matter of fact, I am actually really surprised that the script could even run at all. My error was by not adding the open and close parentheses in my catch statement. I guess I was really tired that night. :rolleyes: However, I will keep you idea in mind, especially when I use the Helium script. I think there is a bug in that too, which sets HeliumOps as a global variable even though there was no variable type of “global” or “local” in front of it.

Thanks for the help:thumbsup: