1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WOO!

Discussion in 'World of SPAM' started by Fexxel, Jun 24, 2009.

  1. Zer0

    Zer0 Level IV

    Joined:
    Mar 2, 2008
    Messages:
    3,037
    Likes Received:
    180
    Location:
    Home sweet home
    You should test your program before uploading
     
  2. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Code (Text):
    1. var item= document.evaluate('//b[. = " & msablist.Items.Item(x) & "]',document, null,
    ^ this.
     
  3. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I do debug and I have tested the model of how the JS programming works and it works.
    I just accidentally forgot to put quotes at the text, so JS treated it as a part of code instead of text to be viewed on a webpage.
     
  4. Zer0

    Zer0 Level IV

    Joined:
    Mar 2, 2008
    Messages:
    3,037
    Likes Received:
    180
    Location:
    Home sweet home
    You should test your actual program to see that it works. Models are idealistic. In practice, they will occasionally fail.
     
  5. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I changed that in v1.4
    That's what I was referring to when I said I messed up with quotes.
    It's actually:
    Code (Text):
    1. var item= document.evaluate('//b[. = "" & msablist.Items.Item(x) & ""]',document, null,
    you need quotes (") wrapped around the item name.
    Or is that not what you are referring to?
     
  6. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    That's the output from v1.4 :S
     
  7. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    Um, the code I'm using with v1.3 +
    Code (Text):
    1. gm.Items.Add("var item= document.evaluate('//b[. = "" & msablist.Items.Item(x) & ""]',document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);if (item.snapshotlength > 0){item = item.snapshotItem(0);selectedlink=item.previousSibling.previousSibling;window.location = selectedlink}return;}")
    so... the quotes ARE there... ? You are looking at old version.
     
  8. Jubixion

    Jubixion Level II

    Joined:
    Jun 11, 2009
    Messages:
    205
    Likes Received:
    14
    Erm sorry to butt in but just wanna say that I didn't create the OCR script myself, it was all LaserWave's coding. Anyway, wouldn't it be better if you just used a loop for the item scanning thing?

    Like first, make a list of items you want:
    Code (Text):
    1. var items = /(Medicinal Soap|Cactopus Cream|etc...)/
    Then if it finds the items in the shop, it clicks on it:
    Code (Text):
    1. if(document.body.innerHTML.indexOf(items) != -1) {
    2.      var item= document.evaluate('//b[. = "+ items +"]',document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    3.      if (item.snapshotLength > 0) {
    4.           item = item.snapshotItem(0);selectedlink=item.previousSibling.previousSibling;
    5.           window.location = selectedlink
    6.      }return;
    7. }
    This is just a rough piece of coding, I'm pretty sure there are errors in the coding part but the general idea is there. Just an idea :/
     
  9. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I'll probably take a stab at that later (how it works out in vb.net)
    Thanks Jubixion :tehe: