PDA

View Full Version : [VB.Net] ABer



Josh
08-25-2014, 03:24 PM
Public Function buyitem(captchaurl, price, itemurl)
Dim capimage As Bitmap = w.GrabPic(captchaurl, w.LastPage)
Dim ocr As New Point
ocr = docap(capimage)
strhtml = w.PostWrapper("[Only registered and activated users can see links]", "current_offer=" & price & "&x=" & ocr.X & "&y=" & ocr.Y, itemurl)
If strhtml.Contains("I accept your") = True Then
'Item bought
Return True
Else
Return False

End If

End Function


Public Function neologin(ByVal user As String, ByVal pass As String)

Dim strhtml As String
strhtml = w.GetWrapper("[Only registered and activated users can see links]", "")
strhtml = w.PostWrapper("[Only registered and activated users can see links]", "username=" & user & "&password=" & pass, "[Only registered and activated users can see links]")


If InStr(strhtml, "Location: /index.phtml") Then
Return True
Else
Return False
End If
End Function




Private Sub cmdneo_Click(sender As Object, e As EventArgs) Handles cmdneo.Click
If String.IsNullOrEmpty(txtneop.Text) Or String.IsNullOrEmpty(txtneop.Text) Then
MsgBox("Username or Password empty")
Else
If neologin(txtneou.Text, txtneop.Text) = True Then
MsgBox("Logged into neo")
cmdstart.Enabled = True
lblstatus.Text = "Status: Logged in"

Else
MsgBox("Failed to login")

End If

End If


End Sub

Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
'Stuffs

Do Until stopit = True


strhtml = w.GetWrapper("[Only registered and activated users can see links]")
If strhtml.Contains("Enter your Neopets login information") Then
neologin(txtneou.Text, txtneop.Text)
End If
strhtml = w.GetWrapper("[Only registered and activated users can see links]")
temp1 = GetBetweenAll(strhtml, "<BR></A><B>", "</B><BR>")
temp2 = GetBetweenAll(Replace(strhtml, ",", ""), "Cost: ", " NP")
temp3 = GetBetweenAll(strhtml, "this.href='haggle.phtml?ob'+'j_info_id=", "';if (!")
SetLabelText_ThreadSafe(lblbuy, "Searching shop...")
For x = 0 To lstsearch.Items.Count - 1
For y = 0 To temp1.Count - 1
If LCase(temp1.Item(y)) = LCase(lstsearch.Items(x)) Then
Setaddlist_ThreadSafe(lstlog, "Found " & temp1.Item(y))
start_time = Now

strhtml = w.GetWrapper("[Only registered and activated users can see links]" & temp3.Item(y), w.LastPage)
cap = "[Only registered and activated users can see links]" & GetBetween(strhtml, "/captcha_show.phtml?_x_pwned=", """")
intpause = GetRandom(Convert.ToInt32(pausemin.Text), Convert.ToInt32(pausemax.Text))
Setaddlist_ThreadSafe(lstlog, "Waiting " & intpause & " ms")
System.Threading.Thread.Sleep(intpause)

If buyitem(cap, temp2.Item(y), "[Only registered and activated users can see links]" & temp3.Item(y)) = True Then
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Bought " & temp1.Item(y))
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Took " & elapsed_time.TotalMilliseconds.ToString("0") & " ms")

Else
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Missed " & temp1.Item(y))
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Took " & elapsed_time.TotalMilliseconds.ToString("0") & " ms")

End If



End If

Next
Next
intref = GetRandom(Convert.ToInt32(refmin.Text), Convert.ToInt32(refmax.Text))


SetLabelText_ThreadSafe(lblbuy, "Pausing " & intref & " ms")
System.Threading.Thread.Sleep(intref)

Loop
SetLabelText_ThreadSafe(lblbuy, "Idle")
End Sub

Most likely not the most efficient code, but gets 950 - 1100 millisecond buys for me. First real program Ive made in like 2+ years.

BEDDOEDv
10-10-2014, 12:43 PM
Public Function buyitem(captchaurl, price, itemurl)
Dim capimage As Bitmap = w.GrabPic(captchaurl, w.LastPage)
Dim ocr As New Point
ocr = docap(capimage)
strhtml = w.PostWrapper("[Only registered and activated users can see links]", "current_offer=" & price & "&x=" & ocr.X & "&y=" & ocr.Y, itemurl)
If strhtml.Contains("I accept your") = True Then
'Item bought
Return True
Else
Return False

End If

End Function


Public Function neologin(ByVal user As String, ByVal pass As String)

Dim strhtml As String
strhtml = w.GetWrapper("[Only registered and activated users can see links]", "")
strhtml = w.PostWrapper("[Only registered and activated users can see links]", "username=" & user & "&password=" & pass, "[Only registered and activated users can see links]")


If InStr(strhtml, "Location: /index.phtml") Then
Return True
Else
Return False
End If
End Function




Private Sub cmdneo_Click(sender As Object, e As EventArgs) Handles cmdneo.Click
If String.IsNullOrEmpty(txtneop.Text) Or String.IsNullOrEmpty(txtneop.Text) Then
MsgBox("Username or Password empty")
Else
If neologin(txtneou.Text, txtneop.Text) = True Then
MsgBox("Logged into neo")
cmdstart.Enabled = True
lblstatus.Text = "Status: Logged in"

Else
MsgBox("Failed to login")

End If

End If


End Sub

Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
'Stuffs

Do Until stopit = True


strhtml = w.GetWrapper("[Only registered and activated users can see links]")
If strhtml.Contains("Enter your Neopets login information") Then
neologin(txtneou.Text, txtneop.Text)
End If
strhtml = w.GetWrapper("[Only registered and activated users can see links]")
temp1 = GetBetweenAll(strhtml, "<BR></A><B>", "</B><BR>")
temp2 = GetBetweenAll(Replace(strhtml, ",", ""), "Cost: ", " NP")
temp3 = GetBetweenAll(strhtml, "this.href='haggle.phtml?ob'+'j_info_id=", "';if (!")
SetLabelText_ThreadSafe(lblbuy, "Searching shop...")
For x = 0 To lstsearch.Items.Count - 1
For y = 0 To temp1.Count - 1
If LCase(temp1.Item(y)) = LCase(lstsearch.Items(x)) Then
Setaddlist_ThreadSafe(lstlog, "Found " & temp1.Item(y))
start_time = Now

strhtml = w.GetWrapper("[Only registered and activated users can see links]" & temp3.Item(y), w.LastPage)
cap = "[Only registered and activated users can see links]" & GetBetween(strhtml, "/captcha_show.phtml?_x_pwned=", """")
intpause = GetRandom(Convert.ToInt32(pausemin.Text), Convert.ToInt32(pausemax.Text))
Setaddlist_ThreadSafe(lstlog, "Waiting " & intpause & " ms")
System.Threading.Thread.Sleep(intpause)

If buyitem(cap, temp2.Item(y), "[Only registered and activated users can see links]" & temp3.Item(y)) = True Then
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Bought " & temp1.Item(y))
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Took " & elapsed_time.TotalMilliseconds.ToString("0") & " ms")

Else
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Missed " & temp1.Item(y))
Setaddlist_ThreadSafe(lstlog, "(" & Now.ToShortTimeString() & ") Took " & elapsed_time.TotalMilliseconds.ToString("0") & " ms")

End If



End If

Next
Next
intref = GetRandom(Convert.ToInt32(refmin.Text), Convert.ToInt32(refmax.Text))


SetLabelText_ThreadSafe(lblbuy, "Pausing " & intref & " ms")
System.Threading.Thread.Sleep(intref)

Loop
SetLabelText_ThreadSafe(lblbuy, "Idle")
End Sub

Most likely not the most efficient code, but gets 950 - 1100 millisecond buys for me. First real program Ive made in like 2+ years.

hi josh, how would i use this code then. I no a little bit about scrips. I know greasemonkey a bit?

j03
10-10-2014, 01:38 PM
hi josh, how would i use this code then. I no a little bit about scrips. I know greasemonkey a bit?

You need to create and design the full program using Visual Studio, and VB.NET is the language.

BEDDOEDv
10-11-2014, 05:00 PM
You need to create and design the full program using Visual Studio, and VB.NET is the language.


i know, i must learn vb for sure!!!!!!

OpTic Specs
06-14-2015, 02:31 PM
Thank you!

Dokeu
06-12-2016, 11:25 AM
I need help to create my ab, with ur code, u can tell me what items need in my AB'? Labels txt box etc.. im new and im very interesed to programing,

j03
06-12-2016, 11:53 AM
I need help to create my ab, with ur code, u can tell me what items need in my AB'? Labels txt box etc.. im new and im very interesed to programing,

You don't need any items on your form for it to be an autobuyer. You just need code that will perform the autobuyer process.


Sent from my iPhone using Tapatalk

Dokeu
06-12-2016, 11:56 AM
You don't need any items on your form for it to be an autobuyer. You just need code that will perform the autobuyer process.


Sent from my iPhone using Tapatalk

I try to create a autobuyer with code, i copy and paste the code on my FORM, charge wrapper, and have many error, have any tutorial?? jajaj im very very very very newbie in create more programs (ONLY CAN CREATE AUTOCLICKS HAHAH) but i had more motivation to learn for programing neopets :B

j03
06-12-2016, 11:57 AM
I try to create a autobuyer with code, i copy and paste the code on my FORM, charge wrapper, and have many error, have any tutorial?? jajaj im very very very very newbie in create more programs (ONLY CAN CREATE AUTOCLICKS HAHAH) but i had more motivation to learn for programing neopets :B

I recommend learning the basics before trying this.


Sent from my iPhone using Tapatalk