[VB6] New Neopets flash game load!!!

Discussion in 'Code Snippets and Tutorials' started by ricky92, May 23, 2007.

  1. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Yes, I found the changes in the flash game load, and I made this simple function to load a flash game into a Shockwave Flash control. Just specify the Flash Control, the name of your wrapper (HTTPWrapper) and then have fun!!! I could make an Inet version of this, but only if someone requests it (it shouldn't be har to convert the code, though)

    Code (Visual Basic):
    1. <div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Public</span> <span style="color: #b1b100;">Function</span> LoadFlashGame<span style="color: #66cc66;">(</span>ByVal strGameID <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span>, ByRef ctlFlash <span style="color: #b1b100;">As</span> ShockwaveFlash, ByRef Wrapper <span style="color: #b1b100;">As</span> Wrap<span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Dim</span> strHTML, strLink, strScore, strTemp <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strHTML = Wrapper.<span style="color: #66cc66;">GetWrapper</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"http://www.neopets.com/games/play.phtml?game_id="</span> & strGameID, <span style="color: #ff0000;">"http://www.neopets.com/games/arcade.phtml"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strScore = GetStringBetween<span style="color: #66cc66;">(</span>strHTML, <span style="color: #ff0000;">"Your High Scores<br /><div class="</span> & <span style="color: #b1b100;">ChrW</span>$<span style="color: #66cc66;">(</span><span style="color: #cc66cc;">34</span><span style="color: #66cc66;">)</span> & <span style="color: #ff0000;">"medText"</span> & <span style="color: #b1b100;">ChrW</span>$<span style="color: #66cc66;">(</span><span style="color: #cc66cc;">34</span><span style="color: #66cc66;">)</span> & <span style="color: #ff0000;">">All Time: "</span>, <span style="color: #ff0000;">"</div>"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strHTML = Wrapper.<span style="color: #66cc66;">GetWrapper</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"http://www.neopets.com/games/play_flash.phtml?va=&game_id="</span> & GameID & <span style="color: #ff0000;">"&nc_referer=neopets&age=1&hiscore="</span> & <span style="color: #b1b100;">Val</span><span style="color: #66cc66;">(</span>strScore<span style="color: #66cc66;">)</span> & <span style="color: #ff0000;">"&sp=0&questionSet=&r=7925819&width=680&height=550&quality=high"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strTemp = GetStringBetween<span style="color: #66cc66;">(</span>strHTML, <span style="color: #b1b100;">ChrW</span>$<span style="color: #66cc66;">(</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">)</span> & <span style="color: #ff0000;">"<script type='text/javascript' src='http://images.neopets.com/flash_movie.js'></script><script type='text/javascript'>flash_object("</span>, <span style="color: #ff0000;">"</script>"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strLink = GetStringBetween<span style="color: #66cc66;">(</span>strTemp, <span style="color: #ff0000;">"'"</span>, <span style="color: #ff0000;">"'"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">ctlFlash.<span style="color: #66cc66;">Movie</span> = strLink</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Function</span></li></ol></div>
    Please, Pankirk, use this in your trainer!!! So people would stop bothering ;)
     
  2. Snowman

    Snowman Level IV

    Joined:
    Apr 9, 2007
    Messages:
    825
    Likes Received:
    0
    Wow ricky thats really good! Hopefully Pankirk can fix his trainer. Does the old Shockwaveflash.loadmovie not work anymore?
     
  3. the_skip

    the_skip Level IV

    Joined:
    Dec 25, 2006
    Messages:
    2,354
    Likes Received:
    1
    Location:
    Indiana
    the ctlfalsh is the same thing. Though it would usually be swf
     
  4. Snowman

    Snowman Level IV

    Joined:
    Apr 9, 2007
    Messages:
    825
    Likes Received:
    0
    So either way would work?
     
  5. Pankirk

    Pankirk Level III

    Joined:
    Nov 12, 2006
    Messages:
    652
    Likes Received:
    28
    Location:
    America
    Rawr. Ill update it :)........ But not now because I have sooooooo much homework! But hopefully on the weekend Ill have time to do it :)

    Edit: good news :) I finished it and now it works with 32 games. 2 of the new ones are MAGaX destroyer and feed florg!
     
  6. mckrazy

    mckrazy Level III

    Joined:
    Jan 24, 2007
    Messages:
    541
    Likes Received:
    0
    Location:
    United Kingdom
    has it been updated at the dl store?

    sorry if grave digging.. cant seem to find the board for this trainer
     
  7. Ice

    Ice Level IV

    Joined:
    May 29, 2007
    Messages:
    847
    Likes Received:
    3
    Sweet a new game sounds fun!

    Thanks, I have to get the new DL too.
     
  8. novalife

    novalife Newbie

    Joined:
    Jun 20, 2007
    Messages:
    14
    Likes Received:
    0
    this sounds good i will download as soon as in shop :D.
     
  9. juandelacruz

    juandelacruz Newbie

    Joined:
    Nov 26, 2007
    Messages:
    14
    Likes Received:
    0
    Sorry for grave digging but does this script still works, I tried it but it seems the strHTML had changed. any idea how to load flash games if it was really changed?
    Thanks..
     
  10. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    There's a new method for loading, I already have it, I'll post it asap. ;)