Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
timer.scheduleAtFixedRate won't stop

 
Post new topic   Reply to topic Printable version
 View previous topic  Where can I get AimBot? Post :: Post Underlords duelsql.dll  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 8:59 pm    Post subject: timer.scheduleAtFixedRate won't stop Reply to topic Reply with quote

Well when i type !flags on it schedules my bot to send *flags every 10 minutes. The only problem if when i type !flags off, it doesn't turn the timertask off.

I tried:

timer.cancel();
task.cancel();
timer = null;
boolean cancel;

nothing turns this fixed rate off. How do i make it go away?

Code: Show/Hide

TimerTask task = new TimerTask(){
public void run(){
m_botAction.sendUnfilteredPublicMessage("*flags");
}
};
if( message.equals( "on" ) ){
tt.scheduleAtFixedRate(task, initialDelay, period);
flagStatus = on;
m_botAction.sendPrivateMessage( name, "Flag Announcing is ON" );
} else if( message.equals("off" ) ){
m_botAction.sendPrivateMessage( name, "Flag announcing off." );
      running=false;
      tt.cancel();
tt=null;
boolean cancel;
    flagStatus = off;
    }
[/code]
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:35
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Sat Oct 29, 2005 9:09 pm    Post subject: Reply to topic Reply with quote

You sure you declared TimerTask() correctly?

I'd imagine something like this:
Code: Show/Hide
timertask = new TimerTask();


Then again, Java is evil. sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:14 pm    Post subject: Reply to topic Reply with quote

Nope icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Oct 29, 2005 9:18 pm    Post subject: Reply to topic Reply with quote

You don't actually have task.cancel(); in that block of code, which should do it. If not, you can use m_botAction.cancelTasks();

Your other option is to keep the task running and then just put a boolean flag within the task

Code: Show/Hide
TimerTask task = new TimerTask()
{
    public void run()
    {
        if(announceFlags)
            m_botAction.sendUnfilteredPublicMessage("*flags");
    }
};

_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:25 pm    Post subject: Reply to topic Reply with quote

Didn't work. This is what i have...

Code: Show/Hide

public void flags(String name, String message){
  if(oplist.isSmod(name)){
Timer tt = new Timer();
int initialDelay = 5000;   // start after 5 seconds
int period = 600000;        // repeat every 10 minutes
TimerTask task = new TimerTask(){
public void run(){
m_botAction.sendUnfilteredPublicMessage("*flags");
}
};
if( message.equals( "on" ) ){
tt.scheduleAtFixedRate(task, initialDelay, period);
flagStatus = on;
m_botAction.sendPrivateMessage( name, "Flag Announcing is ON" );
} else if( message.equals("off" ) ){
m_botAction.sendPrivateMessage( name, "Flag announcing off." );
tt.cancel();
m_botAction.cancelTasks();
    flagStatus = off;
}
}
}
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:25 pm    Post subject: Reply to topic Reply with quote

lemme try ur supplied code 1 sec...
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:27 pm    Post subject: Reply to topic Reply with quote

I tried:

if(flagStatus == off){}
else
m_botAction.sendUnfilteredPublicMessage( "*flags" );
but when they type !flags on again it sets another timer and it runs 2 timers...
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Oct 29, 2005 9:32 pm    Post subject: Reply to topic Reply with quote

Yeah, thats why you'd have to change the code of the !flags command to just change the boolean

Look at the code for bshipbot's night mode to see an example


Last edited by D1st0rt on Sat Oct 29, 2005 9:35 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:34 pm    Post subject: Reply to topic Reply with quote

What do u suggest? icon_rolleyes.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Oct 29, 2005 9:35 pm    Post subject: Reply to topic Reply with quote

I edited not fast enough tongue.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:37 pm    Post subject: Reply to topic Reply with quote

Thank You so much, ill try it.

icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


Age:34
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Oct 29, 2005 9:53 pm    Post subject: Reply to topic Reply with quote

I got it! You sexy hooker. icon_biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 87 page(s) served in previous 5 minutes.

phpBB Created this page in 0.517679 seconds : 36 queries executed (80.3%): GZIP compression disabled