Jump to content

Question with TCP


Recommended Posts

That's fine. It means: The function ran successfully and returned 13474 bytes of data.

In this case your regexp must be wrong ;)

hm.

Here is the original source code of the page(based on acually being logged into it)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Rankings | RUMBLE FIGHTER</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="subject" content="Rumble Fighter" />
<meta name="keywords" content="games, game, gamefactory, game factory, OGP, OG Planet, OGPlanet, OG, Planet, multiplayer, kid game, best kid game, free kid game, kid online game, kid game software, free online kid game, astro, astros, carats, carat, anime, anime picture, anime girl, anime game, full metal alchemist, naruto, naruto style, cute online game, cute game, cute characters, cartoon game, cartoon online game, cartoon style game, best game, video game, online video game, korean video game, korean game, most popular game, most popular online game, free fighting game, multiplayer fighting, fighting game, free fighting, fantasy fighting, fight game, fantasy online fight, fantasy online fighting, free fight game, free fighting game, martial arts, martial arts game, Rumble, Rumble Fighter, RumbleFighter, Online Fighting Game, Multyplayer fighting game, Beat'em Up, 3D Fighting, Exocore, Scroll, Sacred Scroll, Demon King, Fighting, Kungfu, Karate, Boxing, Wrestling, Taekwondo, Gem Fighter" />
<meta name="description" content="Rumble Fighter offers multiplayer online fighting. Are you ready to rumble?" />
<meta name="copyright" content="OGPlanet, OGplanet, Gretech, Nimonix, www.rf.ogplanet.com, 2008" />
<meta name="classification" content="online gaming, free online fighting game, online fighting game, Rumble Fighter" />
<meta name="author" content="OGPlanet - rf.ogplanet.com" />
<meta name="abstract" content="Rumble Fighter – Are you ready to rumble?" />
<link rel="stylesheet" type="text/css" href="http://ui.ogplanet.com/common/css/common.css" />
<link rel="stylesheet" type="text/css" href="http://static.ogplanet.com/static/RF/en/css/layout.css" media="screen" />
<script type="text/javascript" src="http://static.ogplanet.com/static/Common/js/jquery.js"></script>

<script type="text/javascript" language="javascript" src="http://ui.ogplanet.com/common/js/common.js"></script>
<script type="text/javascript" src="http://static.ogplanet.com/static/RF/js/include.js"></script>
<script type="text/javascript" src="http://static.ogplanet.com/static/Common/js/modulecache.js"></script>
<!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="http://static.ogplanet.com/static/RF/en/css/ie6.css" media="screen" />
<![endif]-->

</head>
<body>    
    <!-- universal top menu -->    
    <div id="gnb"></div>
    <script language="javascript" type="text/javascript">
    $(function(){
        gameGNB.setGNB({"auth":"login"});
    }); 
    </script>
    <div id="body_events">

    <div id="community_bg">
    <div id="container" style="">
        <div id="header_sub" style="">
            <script type="text/javascript">
                showFlashObject('5','http://static.ogplanet.com/static/RF/en/swf/sub.swf?menuCode=5', '1000', '225', 'best', 'transparent', '#fff');
            </script>
            <div id="facebook" style="">
                <script>setFacebookUI();</script>            
            </div><!-- end facebook -->
        </div><!-- end header -->

        
        <div style="clear:both;"></div>
        <div id="empty_box"style=""></div>
        <div id="sub_wrapper" style="">
            <div id="leftSide" style="">

                <!--
                <div class="leftPanel">
                    <div id="leftMenu_community">
                        <ul>
                            <li id="leftMenu_list"><a href="http://newforum.ogplanet.com/" id="forum" title="go to forum">&nbsp;</a></li>
                            <li id="leftMenu_list"><a href="rankings.html" id="rankingsActive" title="rankings">&nbsp;</a></li>
                            <li id="leftMenu_list"><a href="polls.html" id="polls" title="polls">&nbsp;</a></li>
                        </ul>
                    </div>
                </div>-->
                <div class="leftPanel">
                    <div id="leftMenu_community2">
                        <ul>

                            <li id="leftMenu_list"><a href="http://newforum.ogplanet.com/" id="forum" title="go to forum">&nbsp;</a></li>
                            <li id="leftMenu_list"><a href="rankings.html" id="rankingsActive" title="rankings">&nbsp;</a></li>
                            <li id="leftMenu_list"><a href="polls.html" id="polls" title="polls">&nbsp;</a></li>
                            <li id="leftMenu_list"><a href="stampCollection.html" id="stamp" title="stamp collection">&nbsp;</a></li>
                        </ul>
                    </div>
                </div>

                <!-- put last left menu -->

                <script>setLeftMenu();</script>
                <!-- put last left menu -->
                
            </div><!-- end leftSide -->
            <div id="sub_Main" style="">
                <div id="subContents" style="">
                    <div id="ranking_body" style="display:none;" >
                        <div id="ranking_head">
                        </div><!-- end page_head -->

                        
                        <h4 class="myrank">My Ranking</h4>
                        <p id="myrank_login" style="display:none;"><a href="https://id.ogplanet.com/ogp/login.og" id="login_msg">LOG IN</a> TO VIEW YOUR RANKING</p>
                        <p id="myrank_not_player" style="display:none">ARE YOU A RUMBLE FIGHTER PLAYER? PLAY RUMBLE FIGHTER TO BE ON THE RANKINGS TODAY!!</p>
                        
                        <div id="myrank_view" style="display:none">
                        </div>

                        <div id="page_info">

                            <span id="current_pg"><strong>1</strong> Page</span> / <span id="total_pg"><strong>5</strong> Pages</span>
                        </div>

                        <span class="rank_TH"></span><!-- rank table head -->
                        <table class="ranking_table" id="table1"><!-- second td:span class can be up, down, and same -->

                            <tbody></tbody>
                        </table>
                        <table class="ranking_table" id="table2" style="display:none;"><tbody></tbody></table>
                        <table class="ranking_table" id="table3" style="display:none;"><tbody></tbody></table>
                        <table class="ranking_table" id="table4" style="display:none;"><tbody></tbody></table>
                        <table class="ranking_table" id="table5" style="display:none;"><tbody></tbody></table>
                        <div id="paging"><!-- paging for pagenation-->
                            <ul>
                                
                                <li><a id="firstPage" style="cursor:pointer;" class="current">1</a></li>

                                <li><a id="secondPage" style="cursor:pointer;">2</a></li>
                                <li><a id="thirdPage" style="cursor:pointer;">3</a></li>
                                <li><a id="fourthPage" style="cursor:pointer;">4</a></li>
                                <li><a id="fifthPage" style="cursor:pointer;">5</a></li>
                                
                            </ul>
                        </div><!--// end paging -->
                    </div><!-- end ranking_body -->

                </div><!-- end subContents -->
            </div><!-- end subMain -->            
        </div><!-- end subwrapper -->        
        <div id="footer_middle_sub" style="">
            <a href="http://www.ogplanet.com/main.og" id="ogplanet" title="OGPlanet" target="_blank"></a>
            <a href="http://company.ogplanet.com" id="about" title="About OGPlanet" target="_blank"></a>
            <a href="#" id="userAgreement" title="User Agreement" onclick="javascript:popup('http://www.ogplanet.com/about.og?op=useragreement');"></a>
            <a href="#" id="privacy" title="Privacy Policy" onclick="javascript:popup('http://www.ogplanet.com/about.og?op=privacypolicy');"></a>
            <a href="http://rf.ogplanet.com/support/helpdesk.html" id="contact" title="Contact Us"></a>

        </div><!-- //end footer_middle -->
    </div><!--// end container -->    
    </div><!-- //end community_bg -->
    </div><!--end body_wrapper -->
    
    <div id="footer_sub" style="">               
    </div><!-- end footer_sub -->
    <script type="text/Javascript">
    $("#firstPage").click(function () {$('.ranking_table').hide();$('#current_pg').html('<strong>1</strong> Page');$('#table1').show();$('span#currentPage').html('<strong>1</strong> Page');$("#paging ul li a").removeClass("current");$(this).addClass("current");});
    $("#secondPage").click(function () {$('.ranking_table').hide();$('#current_pg').html('<strong>2</strong> Page');$('#table2').show();$('span#currentPage').html('<strong>2</strong> Page');$("#paging ul li a").removeClass("current");$(this).addClass("current");});
    $("#thirdPage").click(function () {$('.ranking_table').hide();$('#current_pg').html('<strong>3</strong> Page');$('#table3').show();$('span#currentPage').html('<strong>3</strong> Page');$("#paging ul li a").removeClass("current");$(this).addClass("current");});
    $("#fourthPage").click(function () {$('.ranking_table').hide();$('#current_pg').html('<strong>4</strong> Page');$('#table4').show();$('span#currentPage').html('<strong>4</strong> Page');$("#paging ul li a").removeClass("current");$(this).addClass("current");});
    $("#fifthPage").click(function () {$('.ranking_table').hide();$('#current_pg').html('<strong>5</strong> Page');$('#table5').show();$('span#currentPage').html('<strong>5</strong> Page');$("#paging ul li a").removeClass("current");$(this).addClass("current");});
    
    var module__ = new modulecache();
    module__.getJSON(module__.RANKLIST, {gameName:"rf", page:1, PerPage:100}, ranking);    
    module__.getJSON("/userrank.og", {gameName:"rf"}, userRank);

    function userRank(data) {

        if(data.user.isLogin == '0'){
            $('#myrank_login').show();
        } else if(data.user.isLogin == "1" && data.rank.UserRanking.length == 0) {
            $('#myrank_not_player').show();
        } else if(data.rank.UserRanking.length >= 1) {
            var myrank = $('#myrank_view');        
            progression = 'same';
            if(data.rank.UserRanking[0].Change == 0) {
                progression = 'same';
            } else if (data.rank.UserRanking[0].Change > 0) {
                progression = 'up';
            } else if (data.rank.UserRanking[0].Change < 0) {
                progression = 'down';
                data.rank.UserRanking[0].Change = -(data.rank.UserRanking[0].Change);
            }
            
            myrank.append(
                '<span id="myrank">'+data.rank.UserRanking[0].Rank+'</span>'
                +'<span id="'+progression+'"></span>'
                +'<span id="progression">'+data.rank.UserRanking[0].Change+'</span>'
                +'<span id="name">'+data.rank.UserRanking[0].CharacterName+'</span>'
                +'<span id="exp">'+data.rank.UserRanking[0].Exp+'</span>'
            );
            myrank.show();
        }
    }
        
    function ranking(data){
        var z = $('.ranking_table tbody');
        var tableNum;
        var levelNum;
        z.html('');

        rank = data.RankList.length;
        for(var i = 0; i < rank; i++) {
            if (i < 20){ z = $('#table1 tbody');}
            if (i >= 20 && i < 40){ z = $('#table2 tbody');}
            if (i >= 40 && i < 60){ z = $('#table3 tbody');}
            if (i >= 60 && i < 80){ z = $('#table4 tbody');}
            if (i >= 80 && i < 100){ z = $('#table5 tbody');}
            
            change = 'same';
            changed = '';
            top3ranking = '';
            if(data.RankList[i].Change == 0) {
                change = 'same';
            } else if (data.RankList[i].Change > 0) {
                change = 'up';            
                changed = data.RankList[i].Change;
            } else if (data.RankList[i].Change < 0) {
                change = 'down';
                changed = -(data.RankList[i].Change);
            } 
            
            if (data.RankList[i].Rank < 4) {
                if(data.RankList[i].Rank == 1){
                    top3ranking = 'top1';
                }else if(data.RankList[i].Rank == 2){
                    top3ranking = 'top2';
                }else if(data.RankList[i].Rank == 3){
                    top3ranking = 'top3';
                }
            }

            z.append( '<tr><td class="first"><span class="'+top3ranking+'">' + data.RankList[i].Rank + '</span></td>'
                            +'<td class="second"><span class="'+change+'">'+changed+'</span></td>'
                            +'<td class="third">'+data.RankList[i].nickName+'</td>'
                            +'<td class="fourth">'+data.RankList[i].Exp+'</td></tr>');
            
        }
        $('#ranking_body').show();
    }

    </script>
    <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
          try {
              var pageTracker = _gat._getTracker("UA-3525049-3");
              pageTracker._trackPageview();
          } catch(err) {}
    </script>

    
    <script type="text/javascript" language="javascript">
        function popup(URL) {
            day = new Date();
            id = day.getTime();
            eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=600');");
        }
    </script>

</body>
</html>

You can only check your own ranking only if your logged in. The guy who helped fix my coding last time I lent him a spare account of mine.

Link to comment
Share on other sites

Logging into the page is a completely different story.

Please have a look at this thread. Maybe it helps with your problem.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Logging into the page is a completely different story.

Please have a look at this thread. Maybe it helps with your problem.

Hm, I'm going to explain the full situation then.

What I need is to be able to get my rank from the website but You can only see it if you log in. What I was thinking is to be able to grab the html of a logged in account, so I thought of having it attach to a currently logged in stream of data. You know, like how you are already logged in and if you view the page again its already logged in still. Well I made a web browser that would log into it, manually log in, Not automaticly.

#include <GUIConstants.au3>
#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include "resources.au3"


$GUI = GUICreate("Browser", 1000, 500)
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 0, 30, 1000, 470)
GUISetSTate(@SW_SHOW)

$label = GUICtrlCreateLabel("",0,0,50,50)
$Button1 = GUICtrlCreateButton("Start Tracking",70,0,100,30)
_IENavigate($object, "http://rf.ogplanet.com/community/rankings.html")

While 1
sleep(100)
$msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button1
            $text = _IEBodyReadHTML($Object)
            $aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
            $ranking = $aRanking[0]
            GuiCtrlSetData($label, $ranking)
    EndSelect
WEnd

I was going to try to backtrack the info off the logged in information to continue to check that page for changes. The current code works but it needs to acually visit the web page, while I want it to check it without having to reload the page(For a more efficient process)If you want to test the code you can use my spare

Note on spare: This account is completly useless for acual gameplay for the game just to let people know. This is just for experimenting with my program.

username: -

password: -

So thats the full story. Ill take a look at that thread and still continue to experiment on my problem. You can never move forward without trial and error right? lol.

Edited by KurogamineNox
Link to comment
Share on other sites

just to avoid confusion: this was a reaction on posts #17 #18 ...

whim

Yeah I know, I tested it out with msgbox stuff. I saw that it was in binary, then I added yours and did the test again and it showed the acual html coding. While I am looking for help on here I am still currently working on solutions of my own while going off of peoples suggestions(In case someone here decides to think im lazy and just asking for the code lol) I myself is going through trial and error right now. Might be speeding to fast for my own good though as what I am trying to get revolves 2 programs I tend to make.

Edited by KurogamineNox
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...