taultunleashed logoWindow buttons make script very unstable - wyv - help! : EverQuest 2 Premium Discussions
newtopic  postreply
 [ 9 posts ] 
blue large dot

Window buttons make script very unstable - wyv - help! : EverQuest 2 Premium Discussions

Posted: February 12th, 2005, 3:32 pm
 
richyrich
richyrich's Reps:
User avatar
Ok - I was putting the finishing touches on the v1 of the EQ2Megabot buffbot and added a few buttons to help with some things you can do while the script is running and all heck broke loose! My script was crashing all over the place, to the desktop - very frustrating.

After several hours this morning tracking it down, it appears to be the buttons causing the issue, and as usual, when I find a problem, I try to simply it and reproduce it consistently, which I have.

Below is a very simple script, it just pops up a window with a counter and a Quit button. The Quit functionality is commented out as actually quitting doesn't show the issue.

Wyv - can you please run this script and see if you can find out what is making the buttons so unstable. To make it crash consistently, simply run the script, hit the Quit Button (which does nothing right now) a few times, then hit F1, F2, F1, F2, and shortly it will crash.

When I use these functions in EQ2MegaBot - the script crashes almost immediatly after you hit a button - not good.

I know it has something to do with the handler, but I have reviewed all sample code I can find from the site and it looks like I'm doing everything right.

If you don't ever hit the Quit button, everything is good, you can't make it crash. Seems to me like some memory error with the handler, but I'm stumped.

Here is the code:
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Dim QuitNow

Sub StatusBar(sTxt)
   objStatusWindow.SetStatusBar(sTxt)
End Sub

Class QuitButtonHandlerClass
   Public Function Accepted(nID)
      StatusBar("QUITTING!!")
      'QuitNow = TRUE
   End Function
End Class

' =============================================================
' =============================================================

Class OutputStatusWindowClass

   Private bQuit
   Private Window     'The Script Window
   Private StatusBar
   Private szSchema
   Private handler    ' Handles button press

   Private Sub Class_Initialize()
      szSchema = ""
      szSchema = szSchema & "<?xml version=""1.0""?>                              " + vbCrlf
      szSchema = szSchema & "<XML ID=""XUInterfaceDefinitionLanguage"">               " + vbCrlf
      szSchema = szSchema & "  <Schema xmlns=""XUnleashedData"" xmlns:dt=""XUnleashedDataTypes""/>  " + vbCrlf
      szSchema = szSchema & "  <Window>                                       " + vbCrlf
      szSchema = szSchema & "    <Title>MessageBox</Title>                        " + vbCrlf
      szSchema = szSchema & "    <Left>500</Left>                                 " + vbCrlf
      szSchema = szSchema & "    <Top>20</Top>                                 " + vbCrlf
      szSchema = szSchema & "    <Height>100</Height>                              " + vbCrlf
      szSchema = szSchema & "    <Width>400</Width>                              " + vbCrlf
      szSchema = szSchema & "    <DrawBackground>TRUE</DrawBackground>               " + vbCrlf
      szSchema = szSchema & "    <CloseBox>FALSE</CloseBox>                        " + vbCrlf
      szSchema = szSchema & "    <Container>                                    " + vbCrlf
      szSchema = szSchema & "      <DefaultControlContainer>                        " + vbCrlf
      szSchema = szSchema & "       <Control>                                    " + vbCrlf
      szSchema = szSchema & "           <StaticText>                              " + vbCrlf
      szSchema = szSchema & "             <Name>StatusBar</Name>                     " + vbCrlf
      szSchema = szSchema & "             <Location>                                 " + vbCrlf
      szSchema = szSchema & "                  <X>5</X>                                 " + vbCrlf
      szSchema = szSchema & "                  <Y>40</Y>                                 " + vbCrlf
      szSchema = szSchema & "             </Location>                                 " + vbCrlf
      szSchema = szSchema & "             <Size>                                    " + vbCrlf
      szSchema = szSchema & "                  <CX>390</CX>                              " + vbCrlf
      szSchema = szSchema & "                  <CY>40</CY>                              " + vbCrlf
      szSchema = szSchema & "             </Size>                                    " + vbCrlf
      szSchema = szSchema & "             <Text>** Status Bar **</Text>                        " + vbCrlf
      szSchema = szSchema & "           </StaticText>                              " + vbCrlf
      szSchema = szSchema & "        </Control>                                  " + vbCrlf
      szSchema = szSchema & "       <Control>                                    " + vbCrlf
      szSchema = szSchema & "           <Button>                                 " + vbCrlf
      szSchema = szSchema & "          <Name>btnQuit</Name>                           " + vbCrlf
      szSchema = szSchema & "          <Location>                                 " + vbCrlf
      szSchema = szSchema & "            <X>340</X>                                 " + vbCrlf
      szSchema = szSchema & "            <Y>55</Y>                                 " + vbCrlf
      szSchema = szSchema & "          </Location>                                 " + vbCrlf
      szSchema = szSchema & "          <Size>                                    " + vbCrlf
      szSchema = szSchema & "            <CX>50</CX>                              " + vbCrlf
      szSchema = szSchema & "            <CY>16</CY>                              " + vbCrlf
      szSchema = szSchema & "          </Size>                                    " + vbCrlf
      szSchema = szSchema & "          <Text>QUIT</Text>                              " + vbCrlf
      szSchema = szSchema & "           </Button>                                 " + vbCrlf
      szSchema = szSchema & "        </Control>                                  " + vbCrlf
      szSchema = szSchema & "      </DefaultControlContainer>                        " + vbCrlf
      szSchema = szSchema & "    </Container>                                    " + vbCrlf
      szSchema = szSchema & "    <Background>                                    " + vbCrlf
      szSchema = szSchema & "      <SkinImage>Window-Background</SkinImage>            " + vbCrlf
      szSchema = szSchema & "    </Background>                                 " + vbCrlf
      szSchema = szSchema & "    <Moveable>TRUE</Moveable>                        " + vbCrlf
      szSchema = szSchema & "  </Window>                                       " + vbCrlf
      szSchema = szSchema & "</XML>                                          " + vbCrlf

      Set handler = New QuitButtonHandlerClass

      set Window = XUScriptPlugin.LoadWindow( szSchema )

      set bQuit = XUScriptPlugin.LoadControl( Window,"btnQuit")
      XUScriptPlugin.AddButtonHandler Window, "btnQuit", handler

      set StatusBar = XUScriptPlugin.LoadControl(Window,"StatusBar")

      Window.Title = "EQ2 MegaBot Info"

      'Show the window
      XUScriptPlugin.ActivateWindow Window
   End Sub

   Public Sub SetStatusBar(txt)
      StatusBar.Text = txt
   End Sub

   Private Sub Class_Terminate()
      Dim i

      XUScriptPlugin.RemoveButtonHandler Window, "btnQuit"

      XUScriptPlugin.UnloadControl bQuit
      XUScriptPlugin.UnloadControl StatusBar
      XUScriptPlugin.DeActivateWindow Window
      XUScriptPlugin.UnloadWindow Window
      set handler=NOTHING

   end Sub

End Class

' =============================================================
' =============================================================
Dim i

QuitNow=FALSE
Set objStatusWindow = New OutputStatusWindowClass
i=1
Do While NOT QuitNow
   StatusBar("Loop: " & i)
   XUScriptHost.Sleep 1000
   i = i + 1
Loop
XUScriptHost.Sleep 2000
Set objStatusWindow = NOTHING




Thanks,
Rich


Reply with quote
Posted: February 12th, 2005, 3:48 pm
 
wyvernx

Total Posts: 6718
Joined: May 1st, 2004, 4:00 am
wyvernx's Reps: 21
User avatar
administrator
premium
Couple of things.

If you DO NOT have the EQ2Crafter plugin installed, you will need to check the Compatibility mode checkbox.

If you DO HAVE the EQ2Crafter plugin installed, DO NOT check the compatiblity mode checkbox on the scripting plugin.


Did that help?

_________________
Use Search first, ask questions later!


Reply with quote
Posted: February 12th, 2005, 4:59 pm
 
richyrich
richyrich's Reps:
User avatar
ohhhh - I had no idea - I have ALWAYS been checking the compatilibily mode for EQ2... let me try it.


Reply with quote
Posted: February 12th, 2005, 5:02 pm
 
richyrich
richyrich's Reps:
User avatar
Nope - doesn't help - tried both ways - consistent crashing :-(


Reply with quote
Posted: February 12th, 2005, 6:02 pm
 
wyvernx

Total Posts: 6718
Joined: May 1st, 2004, 4:00 am
wyvernx's Reps: 21
User avatar
administrator
premium
I could not get it to crash.


Do you have an AMD processor?

I'll try to test on my AMD machine here in a bit and see if it crashes there.

_________________
Use Search first, ask questions later!


Reply with quote
Posted: February 12th, 2005, 6:03 pm
 
wyvernx

Total Posts: 6718
Joined: May 1st, 2004, 4:00 am
wyvernx's Reps: 21
User avatar
administrator
premium
If it makes any difference.

I have the EQ2Crafter installed.
NO check in the compatiblilty
No options checked EXCEPT alternate hooking and random filenames.

_________________
Use Search first, ask questions later!


Reply with quote
Posted: February 13th, 2005, 4:04 am
 
richyrich
richyrich's Reps:
User avatar
Yes, I have an AMD - same options checked as you do :-(

I really wanted to add these buttons as having to stop the script, change the INI file, then restart is a pain in the arse! :-)


Reply with quote
Posted: February 13th, 2005, 4:46 am
 
richyrich
richyrich's Reps:
User avatar
Ok - it's AMD :-(

I have 2 AMD boxes, 1 Intel.
BOTH AMD's crash consistently. Hit the Quit button, Hit F1, F2, F1, CRASH.

Can't make it crash on intel.

I will program the buttons using the Intel box, but would really love them to be fixed so it runs on an AMD as my fast machines are AMD, as I'm sure others are.

Any ideas here? Is 100% related to the handlers. If I don't add the handlers to the buttons, no issue.

Rich


Reply with quote
Posted: February 13th, 2005, 1:27 pm
 
wyvernx

Total Posts: 6718
Joined: May 1st, 2004, 4:00 am
wyvernx's Reps: 21
User avatar
administrator
premium
Yep, and everybody always says how good AMD processors are. :P. Now look at them. All banged up and back of the bus.

Had to tease ya a little. hehe.

_________________
Use Search first, ask questions later!


Reply with quote
Want Advertisements After The Last Post Removed? Create A Free Account!

blue large dot Who is online
Users browsing this forum: No registered users and 28 guests

Popular Sections
SWTOR Cheats
Guild Wars 2 Cheats
Guild Wars 2 Hacks
Guild Wars 2 Bots
Diablo 3 Cheats
Guild Wars 2 Mods

Popular Sections
WoW Cataclysm Cheats & Exploits
WoW Cataclysm Hacks & Bots
Star Wars The Old Republic Cheats
SWTOR Mods
Torchlight 2 Cheats
SWTOR Space Mission Bots
Site Nav and RSS
RSS Feed of EverQuest 2 Premium Discussions RSS Feed 
Sitemap of EverQuest 2 Premium Discussions Sitemap 
SitemapIndex SitemapIndex
RSS Feed RSS Feed
Channel list Channel list
left bottom corner Site and Contents Copyright 2001-2012 All Rights Reserved TaultUnleashed.com bottom corner
top left
top right
createaccount
Username:   Password:   Remember Me?