Quantcast

Jump to content


Photo

[VB.NET] Using QuickStock to deposit the whole inventory


  • Please log in to reply
8 replies to this topic

#1 GetJinxed

GetJinxed
  • Reckless Cheater

  • 1423 posts


Users Awards

Posted 14 May 2016 - 04:53 PM

Hey guys i've recently decided to start programming and this time try to re-learn and mix it with Neopets. I'm trying to learn some things first before deciding on what type of program I wanna do. However there's one thing that's grinding my gears. Messing with the quickstock page and make it depoist the whole inventory.

 

I'm using VS 2008 and using a HTTP Wrapper I found around some other forum.

 

From the info i gathered using Chrome this is the info that's sent when depositing a inventory with 4 codestones :

buyitem:0
id_arr[1]:1862668738
radio_arr[1]:deposit
id_arr[2]:1862668739
radio_arr[2]:deposit
id_arr[3]:1862668740
radio_arr[3]:deposit
id_arr[4]:1862668741
radio_arr[4]:deposit
checkall:on

However it all depends on the item IDs or something :/ Can't really understand. But when further investigating this is the parameter that gets sent : buyitem=0&id_arr%5B1%5D=1862668738&radio_arr%5B1%5D=deposit&id_arr%5B2%5D=1862668739&radio_arr%5B2%5D=deposit&id_arr%5B3%5D=1862668740&radio_arr%5B3%5D=deposit&id_arr%5B4%5D=1862668741&radio_arr%5B4%5D=deposit&checkall=on

 
So I guess it depends on how many items the inventory has which define the vector length and the IDs. I'm not sure if this is the proper way or if i'm over complicating too much. But theorically what the program would need to do is check for the vector length and the according ids and send them to the url : http://www.neopets.c...uyitem=0&id_arr
 
Been trying to understand how the info gets sent but I'm unable to replicate it  :/
 
Another option i thought about would be to read the HTML source of the page and simulate a click on the radio button to "check all" and then submit. Is that even possible with a httpwrapper? I only found examples using the webcontrol. Sorry for the noobs questions I have never messed with internet pages. All my VB knowledge is just for offline stuff such as interacting with databases  :unsure:

Edited by GetJinxed, 14 May 2016 - 04:53 PM.


#2 WarezHaxor

WarezHaxor
  • 668 posts


Users Awards

Posted 14 May 2016 - 05:58 PM

Someone with a bit more knowledge correct me if I'm wrong, but I don't believe you can simulate clicking the all button through a wrapper. I'll have to look at the quick stock source real quick but roughly you'll need to enumerate each item ID and create your link incorporating the item id's. So you create an array of 10 items you're depositing by gathering the id's from the page source, you add that many object id's into the quick stock function and pass it off to the server with the array you grabbed from the source earlier.

#3 GetJinxed

GetJinxed
  • Reckless Cheater

  • 1423 posts


Users Awards

Posted 14 May 2016 - 06:14 PM

So that's similar to what I meantioned first, right? Seems a bit complicated but I'll try to understand how the wrapper works. Specially when it detects strings from the source code x_x 


Edited by GetJinxed, 14 May 2016 - 06:14 PM.


#4 Nano

Nano
  • a delicious kiwi

  • 325 posts


Users Awards

Posted 14 May 2016 - 07:37 PM

What I used to do was extractall/matchall/getbetweenall/regexwhatever the params from the page source. Insert those into a listbox/listview, pass all the ids into it. Then the action in the next column. Then loop it through that list to get the postdata.

 

Can also be done with arrays.



#5 GetJinxed

GetJinxed
  • Reckless Cheater

  • 1423 posts


Users Awards

Posted 14 May 2016 - 07:42 PM

What I used to do was extractall/matchall/getbetweenall/regexwhatever the params from the page source. Insert those into a listbox/listview, pass all the ids into it. Then the action in the next column. Then loop it through that list to get the postdata.

 

Can also be done with arrays.

 

Alright thank you very much! I'll give that a shot  :)



#6 Nano

Nano
  • a delicious kiwi

  • 325 posts


Users Awards

Posted 14 May 2016 - 07:53 PM

Alright thank you very much! I'll give that a shot  :)

 

Feel free to PM any questions.



#7 GetJinxed

GetJinxed
  • Reckless Cheater

  • 1423 posts


Users Awards

Posted 14 May 2016 - 08:07 PM

Feel free to PM any questions.

 

Will do :) First i'll need to learn more about how to use those functions because it's the first time i "scrap" info from HTML source and mess with it :p I'm pretty sure i'll get stuck a lot during this process  :rolleyes:



#8 WarezHaxor

WarezHaxor
  • 668 posts


Users Awards

Posted 15 May 2016 - 12:35 AM

Exactly @GetJinxed. A list box may be better for starting out instead of an array, as you can see the data extracted and see for yourself if you need to change the parameters to extract the strings so you're getting only the data you need.

#9 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 15 May 2016 - 03:14 AM

I'd probably go for Regex and a MatchCollection just out of simplicity but there are plenty of options like basic string manipulation (which you should learn from the start anyway) within a loop, using Xpaths or DOM traversal with the HTML Agility pack etc. After you've got your IDs you just need to format them to match the post data and then send it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users