ok how would i set up my bot to connect to a site or server before to check if it is a legit copy of the bot? This would be before it connected to battle.net
vb im guessing? use the inet functions.
inet?
its a vb ocx u can add it to your project, where u can get stuff from the internet like read a txt uploaded somewhere and set it to a text box on a form when it receives it.
i c. Could i set up inet to get news about my bot too?
yes.. all u do is upload news.txt to a brinkster or whatever free web host and use it to get whast in text file
Dim Site As String
Dim strNews As String
Site = "http://www33.brinkster.com/BLEHBLEHWHATEVER/"
txtNews.Text = Replace(Inet1.OpenURL(Site & "news.txt"), Chr(10), vbCrLf)
strNews = txtNews.Text
stripped down version of what i'm using
Public Function CheckVer() As Boolean
Dim URL As String
URL = "http://www.clanbnu.net/bnubotcheck.php"
URL = URL & _
"?app=" & App.Title & _
_
"&ver1=" & App.Major & _
"&ver2=" & App.Minor & _
"&ver3=" & App.Revision
CheckVer = CheckVerPart2(URL)
...
Public Function CheckVerPart2(URL As String) As Boolean
CheckVerPart2 = False
TXT = ""
frmSetup.Inet1.Execute URL
While frmSetup.Inet1.StillExecuting
Sleep 100
DoEvents 'play fair...
Wend
Dim resp As String
On Error Resume Next
resp = frmSetup.Inet1.GetChunk(65535) '1024)
If Len(resp) = 0 Then
MsgBox "Error in version check; The server may be down."
End
Else
(code that parses the response)
thats like... horrible. why would you put sleep on a loop?! your stopping your program for quite some time depending on the speed of the webserver. instead, in the inet(eww!) data arrival event, just grab the stuff there.
Quotethats like... horrible. why would you put sleep on a loop?! your stopping your program for quite some time depending on the speed of the webserver. instead, in the inet(eww!) data arrival event, just grab the stuff there.
To be fair, at least sleep gives up the rest of the thread's time-slice in the operating system, so it doesn't work at 100% cpu while it's waiting.
bingo; the server is slow
sleep and doevents do totally different thing and give simmilar effects. sleep STOPS the program for x miliseconds. doevents just 'tricks' the system into thinking it's time to move on to the next running thread. if no other programs are running, a loop with only doevents in it can cause major cpu hoggage (hoggitude? hoggification? ;))
I posted on the forums before code to properly make an http request using a winsock control... maybe you can do a search for it?
i *know* how to do that; that doesnt make the server any faster
it's got a shitty host
and noodles, inet has no data arrival event, only a statechanged event. and htere's like a zillion different states that all mean one of two things. my code is MUCH simpler.
theres a solution to that- use winsock.
btw, theres an edit button. you didn't need to make 3 posts all containing 1 sentence
Noodlez, he posted a total of three messages, all containing more than one sentence. Come on guys, lets learn how to count before flaming on here.
huh, warz? anyways,
Private Sub connect_click()
Inet1.OpenURL "the site to check"
IF Inet1.OpenURL = Text1.Text then RealConnect
Else
winsock1.close
addtext "Verification or w/e failed"
for realconnect, you would add a function that connects.
you would make text1 invisible, and make the text whatever the inet connects to. Not very reliable and probably very easy to crack, but hey, i TRIED to give my 2cents. =p
Noodlez, that post was redundant. I'm sorry :'(