aMSN Forums
May 24, 2013, 06:53:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Tcl threads?  (Read 8433 times)
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #15 on: June 03, 2009, 10:32:27 pm »

Hi, I got your plugin and I tested it a few times, it never disable any plugin, it worked normally.. so I 'm not sure exactly why it happens for you and not for me.. anyways, i took a quick look at your code and sorry but it's really bad!
first, use 'variable' not 'global'...
secondly, use ::plugins::UnloadPlugin instead of just calling 'deinit'..
third, you do [open oldquotes.txt], that's bad, because it will try to write to /usr/share/amsn/oldquotes.txt, you should instead use $HOME to write in the user's profile directory.
You also try to open plugins/autoquoter/quotes.txt.. but what if the user installed the plugin in ~/.amsn/plugins and not in /usr/share/amsn/plugins, it won't work.. you must save your $dir received in the Init proc into a namespace variable and use it like this : [open [file join $dir quotes.txt]]
You should also use the 'after cancel'  instead of the $run variable...
You should use plugins_log instead of status_log,
you should  use 'catch' in order to catch errors when doing 'unset' or 'open'...
your last quote will never be shown because when you set it, you increment the index counter and you check if it > num_frases, then you set the index to 0 and change the psm again
you never check whether you are online or offline... you can't change the psm when offline, so you must make sure that the ::MSN::myStatusIs != FLN...
that's about it, that's what I saw when i quickly browsed through the code...
Logged

KaKaRoTo
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!