StealthBot.net: Resolved: can i have different timer in different scripts? - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Resolved: can i have different timer in different scripts?

#1 User is offline   uncleZ Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: March-07 10

Posted March 19, 2010 - 09:36 AM

--script1.txt--
scTimer.Interval = 10
scTimer.Enabled = True

Sub scTimer_Timer()
....action....
End Sub


--script2.txt--
scTimer.Interval = 1000
scTimer.Enabled = True

Sub scTimer_Timer()
....action....
End Sub

Because... if i load multiple scripts it seems to set all timers to 1000 or probably the last loaded script...

if so... i must set a global scTimer.Interval and then enable the sub in various scripts timing all of them to the minimum value?

thank you

#2 User is offline   uncleZ Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: March-07 10

Posted March 19, 2010 - 12:53 PM

ok scTimer.Interval seems to be such a super global, if i use it in multiple scripts when bot load config set scTimer.Interval to the value of last script loaded alphabetically

there's a way to isolate timers? otherwise i should set a unique global timer really low like scTimer.Interval = 10 then set all timers to bigger values... but this can lead to over cpu usage..

#3 User is offline   AwaKening Icon

  • how do ya like me now
  • PipPipPipPipPip
  • Group: Members
  • Posts: 977
  • Joined: August-20 09

Posted March 19, 2010 - 02:59 PM

Pick a different timer name. scTimer is internal.

CreateObj "LongTimer", "timername"
timername.Interval = 10    '// 10 seconds
timername.Enabled = True

CreateObj "Timer", "timername"
timername.Interval = 1000   '// 1 second (1000 milliseconds)
timername.Enabled = True


#4 User is offline   uncleZ Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: March-07 10

Posted March 19, 2010 - 03:47 PM

View PostAwaKening, on 19 March 2010 - 02:59 PM, said:

Pick a different timer name. scTimer is internal.

CreateObj "LongTimer", "timername"
timername.Interval = 10    '// 10 seconds
timername.Enabled = True

CreateObj "Timer", "timername"
timername.Interval = 1000   '// 1 second (1000 milliseconds)
timername.Enabled = True


ok and how i can racall a sub?

Sub timername_Timer()
End Sub

???

yes it seems work fine ;)

#5 User is offline   AwaKening Icon

  • how do ya like me now
  • PipPipPipPipPip
  • Group: Members
  • Posts: 977
  • Joined: August-20 09

Posted March 19, 2010 - 03:53 PM

I have marked this topic as resolved. If you did not receive a satisfactory response please reply and provide as much relevant information as possible.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users