Valhalla Legends Forums Archive | Battle.net Bot Development | Verification server

AuthorMessageTime
PaiD
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
February 16, 2003, 12:30 AM
sOuLz
vb im guessing?  use the inet functions.
February 16, 2003, 7:24 PM
PaiD
inet?
February 16, 2003, 8:18 PM
Guest
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.
February 16, 2003, 8:31 PM
PaiD
i c. Could i set up inet to get news about my bot too?
February 16, 2003, 10:07 PM
Guest
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

[code]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[/code]
February 16, 2003, 10:23 PM
Camel
stripped down version of what i'm using

[code]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)
...[/code]
[code]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)[/code]
February 22, 2003, 4:56 PM
Noodlez
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.
February 23, 2003, 2:15 AM
iago
[quote]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.[/quote]

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.
February 23, 2003, 4:55 AM
Camel
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?  ;))
February 23, 2003, 11:58 AM
Atom
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?
February 23, 2003, 2:14 PM
Camel
i *know* how to do that; that doesnt make the server any faster
it's got a shitty host
February 23, 2003, 2:52 PM
Camel
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.
February 23, 2003, 3:05 PM
Noodlez
theres a solution to that- use winsock.

btw, theres an edit button. you didn't need to make 3 posts all containing 1 sentence
February 24, 2003, 6:29 PM
warz
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.
February 24, 2003, 8:04 PM
haZe
huh, warz? anyways,
[code]
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"
[/code]
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
February 24, 2003, 8:30 PM
St0rm.iD
Noodlez, that post was redundant. I'm sorry  :'(
February 25, 2003, 5:14 PM

Search