Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
I don't think I need to show you all the code
static void Coin() {
while(true) {
Thread.Sleep(1);
con.Send("b", 1, 1, 22, 100);
}
}
while(true) makes the loop infinite, i checked that.
If Thread.Sleep is 17, the Bot crashes, with low values till ~5 he doesn't crash, but doesn't place coin, in some other ways he places the coin then crashes instead of replacing the coin again and again...
Where in your code is this? If its inside a playerIO message, then I think its because it stops the thread from running
Just a quick explanation:
The average bot has 2 threads (at least 2 that you need to worry about), which are basically points in the program being run
One is the main one, which enters the program in the Main void
The other is used by PlayerIO
The PlayerIO cant have anything in it that takes a long period of time, otherwise nothing else can happen in it, so it disconnects
If you really want it to work like this, you have a few options:
Add a timer, which fires every few milliseconds
Run this code on a new thread
Here is an example for the new thread (the easiest):
static void Coin() {
new Thread(() =>
{
while(true) {
Thread.Sleep(1);
con.Send("b", 1, 1, 22, 100);
}
}).Start();
}
you also need "using System.Threading;" at the top
Also, a quick note:
There isnt a major difference between sleep 1 and sleep 10 in most computers, the smallest possible sleep is around 15 ms
There are a few exceptions, but in most cases, there is no difference below 5
Offline
This is another bot
Level owners no longer have a message limit, so it is possible to "crash" your own word now.
There isnt a major difference between sleep 1 and sleep 10 in most computers, the smallest possible sleep is around 15 ms
There are a few exceptions, but in most cases, there is no difference below 5
This is only true for laptops and other battery powered machines. Even then, it is possible to reduce the timer resolution by using the WinAPI. (Or you know, open a youtube video and that video will reduce the timer resolution for you since it is a system wide setting!)
I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.
Offline
Level owners no longer have a message limit, so it is possible to "crash" your own word now.
With an interval of 17, it shouldnt crash though...
Im guessing that it is blocking the PlayerIO thread, so it cant send / recieve / process messages
This is only true for laptops and other battery powered machines. Even then, it is possible to reduce the timer resolution by using the WinAPI. (Or you know, open a youtube video and that video will reduce the timer resolution for you since it is a system wide setting!)
It's been the case for every computer I've tested (3 desktop PCs and a laptop)
Also, I thought Google (and a few other companies) removed the increase in resolution from most of their programs a while ago
Offline
Pages: 1
Topic closed
[ Started around 1732395917.0832 - Generated in 0.041 seconds, 14 queries executed - Memory usage: 1.4 MiB (Peak: 1.5 MiB) ]