Page 1 of 3 123 LastLast
Results 1 to 25 of 52

Thread: [FIX] SMART Won't Load Error

  1. #1
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default [FIX] SMART Won't Load Error

    This is a hackish solution thrown together quickly to band-aid the problem - a better snippet will be edited in soon. If it doesn't work on your first try, stop the script and press play again.

    Today's update broke SRL-6's getParameters. ogLib scripts still function correctly. Until an official patch is made to SRL-6, simply paste the following code into your script:

    Simba Code:
    function tIntegerArray.contains(funcID: int32): boolean;
    var
      funcIndex: int32;
    begin
      for funcIndex to high(self) do
        if self[funcIndex] = funcID then
        begin
          result := true;
          break;
        end;
      exit(result);
    end;  

    function smartGetParameters(out params: tStringArray): boolean; override;
    var
      funcAttempts, funcIndex, funcRandom, funcResultIndex: int32;
      funcExcludeList: tIntegerArray = [13, 47, 55, 75, 90, 93, 94, 95, 101, 102, 107, 109, 110, 111, 112, 113, 118, 121, 122, 125, 126, 127, 128, 129, 130, 131, 132, 133];
      funcPage: string;
      funcPageExplode: tStringArray;
    begin
      for 0 to 10 do
      begin
        while true do
          if not funcExcludeList.contains(funcRandom := random(1, 150)) then
            break;
        funcPage := getPage('http://world' + toStr(funcRandom) + '.runescape.com/jav_config_beta.ws');
        if pos('404 - Page not found', funcPage) = 0 then
        begin
          setLength(params, length(funcPageExplode := explode(#10, funcPage)));
          for funcIndex to high(funcPageExplode) do
            if execRegExpr('^(codebase|param)=(.+)', funcPageExplode[funcIndex]) then
            begin
              params[funcResultIndex] := replaceRegExpr('^(codebase|param)=(.+)', funcPageExplode[funcIndex], '$2', true);
              funcResultIndex += 1;
            end;
          break;
        end;
      end;
      setLength(params, funcResultIndex);
      exit(true);
    end;

    Picture of SRL-6 SMART working:

    Last edited by Clarity; 04-18-2016 at 04:42 PM.

  2. #2
    Join Date
    May 2012
    Location
    canada
    Posts
    69
    Mentioned
    6 Post(s)
    Quoted
    27 Post(s)

    Default

    thank you very much it work like a charm

  3. #3
    Join Date
    May 2011
    Location
    In an Island.
    Posts
    1,413
    Mentioned
    2 Post(s)
    Quoted
    149 Post(s)

    Default

    Thanks for the solution Clarity!
    ''If you want something you've never had, you have to do something you've never done''


    total leve 2715/1b exp +... exterminated.

  4. #4
    Join Date
    Feb 2012
    Posts
    64
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    Confirmed working in Mud Rune script . Thanks for this, copy / paste - working. Appreciate you being so quick off the mark. I owe you one, would never have managed this myself.

  5. #5
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Has anyone looked into what smart does with this "magical" parameter string?

    You should give it the link that you enter into your browser, then SMART will parse that page and add the needed parameters, but weirdly smart won't spawn if you don't pass a parameter and that really makes no sense.

    The only use I see for smarts 'params' parameter is for setting the language which used to be j=0, j=1, j=2 etc.

    I stand corrected if i'm wrong, but I don't see how adding all these parameters make a difference.
    Last edited by Olly; 04-18-2016 at 05:28 PM.

  6. #6
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Has anyone looked into what smart does with this "magical" parameter string?

    You should give it the link that you enter into your browser, then SMART will parse that page and add the needed parameters, but weirdly smart won't spawn if you don't pass a parameter and that really makes no sense.

    The only use I see for smarts 'params' parameter is for setting the language which used to be j=0, j=1, j=2 etc.

    I stand corrected if i'm wrong, but I don't see how adding all these parameters make a difference.
    Does this help at all?

    Simba Code:
    __smartCurrentTarget := smartSpawnClient(path, stringReplace(PluginPath, '\', '/', [rfReplaceAll]),
                                               params[0], ',' + params[1], w, h, smartInitSeq, smartUserAgent, '', plugins);

    Edit: params[1] is useless it seems?
    This code also launches smart:
    Simba Code:
    __smartCurrentTarget := smartSpawnClient(path, stringReplace(PluginPath, '\', '/', [rfReplaceAll]),
                                               params[0], ',' + 'hello', w, h, smartInitSeq, smartUserAgent, '', plugins);

  7. #7
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Does this help at all?

    Simba Code:
    __smartCurrentTarget := smartSpawnClient(path, stringReplace(PluginPath, '\', '/', [rfReplaceAll]),
                                               params[0], ',' + params[1], w, h, smartInitSeq, smartUserAgent, '', plugins);

    Seems relevant:

    https://github.com/BenLand100/SMART/...ient.java#L653

    Code:
    private void initApplet(String root, String params) throws Exception {
            String jsInfoPage = downloadHTML(root + params);
            jsInfoPage = jsInfoPage.substring(Math.max(jsInfoPage.indexOf("<applet"), jsInfoPage.indexOf("write('<app")), jsInfoPage.indexOf("</applet>"));
            Main.debug("Applet Loader Parsed");
            String archive = parseArg(search(jsInfoPage, archiveRegex, 1));
            if (!archive.startsWith("http://")) archive = root + archive;
            Main.debug("Using jar: " + archive);
            JarURLConnection clientConnection = (JarURLConnection) new URL("jar:" + archive + "!/").openConnection();
            //Store the manifest hash here           
            manifestHash = clientConnection.getManifest().hashCode();
            //This might need some work, I didn't write it and I'm not sure how accurate it is
    		clientConnection.addRequestProperty("Protocol", "HTTP/1.1");
    		clientConnection.addRequestProperty("Connection", "keep-alive");
    		clientConnection.addRequestProperty("Keep-Alive", "200");
    		//This useragent it for the java plugin, probably shouldn't mess with it
    		clientConnection.addRequestProperty("User-Agent", "Mozilla/4.0 (" + System.getProperty("os.name") + " " + System.getProperty("os.version") + ") Java/" + System.getProperty("java.version"));
            thisLoader = AppletClassLoader.newInstance(new URL[] { clientConnection.getJarFileURL() });
            clientApplet = (Applet) (thisLoader.loadClass(parseArg(search(jsInfoPage, codeRegex, 1)).replaceAll(".class$", "")).newInstance());
            HashMap<String, String> paramMap = new HashMap<String, String>();
            paramMap.put("width", parseArg(search(jsInfoPage, widthRegex, 1)));
            paramMap.put("height", parseArg(search(jsInfoPage, heightRegex, 1)));
            Matcher matcher = Pattern.compile("<param name\\=([^ ]*) [^>]*value\\=([^>]*?)/?>").matcher(jsInfoPage);
            while (matcher.find()) {
                //Main.debug(parseArg(matcher.group(1)) + " -> " + parseArg(matcher.group(2)));
                paramMap.put(parseArg(matcher.group(1)), parseArg(matcher.group(2)));
            }
            ClientStub stub = new ClientStub(root +  parseArg(search(jsInfoPage, archiveRegex, 1)), root, paramMap);
            clientApplet.setStub(stub);
            clientApplet.setPreferredSize(new Dimension(width, height));
            stub.active = true;
            Main.debug("Applet Parameters Forwarded");
        }
    Last edited by Clarity; 04-18-2016 at 05:47 PM.

  8. #8
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Even this 'works':
    Simba Code:
    function smartGetParameters(out params: TStringArray): boolean;
    var
      page: string;
    begin
      params := ['http://world' + toStr(random(1,150)) + '.runescape.com/', 'secondParam'];
     // page := getPage(SMART_URL);

     // params := explode(',', between('worldLink=''', '''', page));

      result := (length(params) = 2);

      if (not result) then
      begin
        print('Error while grabbing parameters', TDebug.ERROR);
        print('Make sure you can reach the RS website, and no active firewall is blocking Simba', TDebug.HINT);
        exit(false);
      end;

      print('smartGetParameters(): Succesfully grabbed paramters', TDebug.SUB);
    end;

  9. #9
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Even this 'works':
    Simba Code:
    function smartGetParameters(out params: TStringArray): boolean;
    var
      page: string;
    begin
      params := ['http://world' + toStr(random(1,150)) + '.runescape.com/', 'secondParam'];
     // page := getPage(SMART_URL);

     // params := explode(',', between('worldLink=''', '''', page));

      result := (length(params) = 2);

      if (not result) then
      begin
        print('Error while grabbing parameters', TDebug.ERROR);
        print('Make sure you can reach the RS website, and no active firewall is blocking Simba', TDebug.HINT);
        exit(false);
      end;

      print('smartGetParameters(): Succesfully grabbed paramters', TDebug.SUB);
    end;
    Lol. Hence why I didn't want to pull request SRL-6 since I didn't understand what was truly 'correct.'

  10. #10
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Code:
    String jsInfoPage = downloadHTML(root + params);
    That's ALL it does with the parameters you give smart, and that's equivalent to:

    Simba Code:
    str := GetPage(root + params);
    // then with this string, we extract the jar URL, and the params needed
    I would also assume the parameters smart passes to the applet are massively outdated. IIRC it should grab the params from http://world2.runescape.com/jav_config_beta.ws and pass them.

  11. #11
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    This is something benland posted a while ago on his github:
    Simba Code:
    program new;

    var
    root,params: string;

    procedure GetSmartParams(var root,params: string);
    var
      path: String;
      loc: integer;
    begin
      path:= Between('<iframe id="game" src="', '" frameborder', GetPage('http://www.runescape.com/game.ws?j=1'));
      loc:= pos('runescape.com/',path);
      root:= Copy(path,0,loc+13);
      params:= Copy(path,loc+14,length(path)-loc+14);
      writeln(root);
      writeln(params);
    end;

    begin
    GetSmartParams(root, params);
    end.

    Unsure how helpfull this is?

  12. #12
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Code:
    String jsInfoPage = downloadHTML(root + params);
    That's ALL it does with the parameters you give smart, and that's equivalent to:

    Simba Code:
    str := GetPage(root + params);
    // then with this string, we extract the jar URL, and the params needed
    I would also assume the parameters smart passes to the applet are massively outdated. IIRC it should grab the params from http://world2.runescape.com/jav_config_beta.ws and pass them.
    Or the non beta version of the link.
    http://world2.runescape.com/jav_config.ws

  13. #13
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Or the non beta version of the link.
    http://world2.runescape.com/jav_config.ws
    That better lol, just copied the link from when it was posted on this thread.

  14. #14
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Code:
    var worldLink='http://world23.runescape.com/,j0,f7691417549404626629,iDBXPZaBPotHnzeZldoHBTxXnbnMFe3VcAAAAAAA'
    From: http://www.runescape.com/game-applet which is the link I get when clicked "play on browser"

    SO - From view source on Firefox:
    Simba Code:
    Root = 'http://world23.runescape.com/'
    Params = ',j0,f7691417549404626629,iDBXPZaBPotHnzeZldoHBTxXnbnMFe3VcAAAAAAA'

    But you want a method to grab it, so:

    Simba Code:
    function SmartGetParameters(out params: TStringArray): Boolean; override;
    var
      WorldLink: String;
      p: Integer;
    begin
      WorldLink := Between('var worldLink=', ''',', GetPage('http://www.runescape.com/game-applet'));
      p := Pos('com/', WorldLink);
      Params := Params + Copy(WorldLink, 2, p + 2);
      Params := Params + Copy(WorldLink, p + 4, Length(WorldLink));

      Writeln('root = ', Params[0]);
      Writeln('params = ', Params[1]);

      Result := True;
    end;

    Which gives me:

    Code:
    root = http://world16.runescape.com/
    params = ,j0,f6967515942099270596
    So when running though firefox it gives a extra parameter
    Last edited by Olly; 04-18-2016 at 06:48 PM.

  15. #15
    Join Date
    Apr 2016
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    i posted your code to the end of my script and i get the same exact error it says compiled successfully then it says:

    The following bitmaps were not freed: [SMART Debug Image]

    this is the whole thing:

    Compiled successfully in 4259 ms.
    SRL: Logfile = C:\Simba\Includes\SRL-6/logs/SRL log (18-04-16 at 11.33.05 AM).txt
    -- setupSRL()
    ---- Setting up SRL...
    ---- attempting to spawn smart, attempt #: 1
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- attempting to spawn smart, attempt #: 2
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- attempting to spawn smart, attempt #: 3
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- attempting to spawn smart, attempt #: 4
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- attempting to spawn smart, attempt #: 5
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- attempting to spawn smart, attempt #: 6
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found no free clients to pair to
    ------ smartPairToExistingClient(): result = false
    ------ Attempting to spawn a new client..
    ------ smartCreateClient():
    -------- ERROR: Error while grabbing parameters
    -------- HINT: Make sure you can reach the RS website, and no active firewall is blocking Simba
    ------ Failed to grab parameters
    ---- initSmart() result = False
    ---- FATAL ERROR: smartSetupDrawing(): Unable to setup SMART drawing
    ---- Succesfully freed SMART[0]
    Successfully executed.
    The following bitmaps were not freed: [SMART Debug Image]

  16. #16
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by JMW View Post
    Tons of spam...
    Anyway if you want something you can paste into your script here you are:
    Simba Code:
    function SmartGetParameters(out params: TStringArray): Boolean; override;
    var
      WorldLink: String;
      p: Integer;
    begin
      WorldLink := Between('var worldLink=', ''',', GetPage('http://www.runescape.com/game-applet'));
      p := Pos('com/', WorldLink);
      Params := Params + Copy(WorldLink, 2, p + 2);
      Params := Params + Copy(WorldLink, p + 4, Length(WorldLink));

      Writeln('root = ', Params[0]);
      Writeln('params = ', Params[1]);

      Result := True;
    end;
    Don't add it at the end of the script, Lape doesn't even check past the "begin end." block

  17. #17
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Simba Code:
    function SmartGetParameters(out params: TStringArray): Boolean; override;
    var
      WorldLink: String;
      p: Integer;
    begin
      WorldLink := Between('var worldLink=', ''',', GetPage('http://www.runescape.com/game-applet'));
      p := Pos('com/', WorldLink);
      Params := Params + Copy(WorldLink, 2, p + 2);
      Params := Params + Copy(WorldLink, p + 4, Length(WorldLink));

      Writeln('root = ', Params[0]);
      Writeln('params = ', Params[1]);

      Result := True;
    end;

    Which gives me:

    Code:
    root = http://world16.runescape.com/
    params = ,j0,f6967515942099270596
    Perhaps the p+4 has to be p+5? So the second param doesnt start with a , ?

  18. #18
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    ...
    It's all fixed up, just never updated the output on that post.

  19. #19
    Join Date
    Apr 2016
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    u guys are legends thx so much

  20. #20
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    It's all fixed up, just never updated the output on that post.
    Can you create a pull request on the srl6 github?

  21. #21
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Can you create a pull request on the srl6 github?
    No, since it will never reach the users lol.

  22. #22
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    No, since it will never reach the users lol.
    SRL6 github updates do get pushed, just has to be done manually. So they will reach the users.

  23. #23
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    No, since it will never reach the users lol.
    Why wont it? Just bug wizzup. He pushed everything the other day and fixed up the cron job (which wasn't firing for some reason)
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  24. #24
    Join Date
    Dec 2012
    Posts
    33
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    Absolute legend. Thank you for the fix!

  25. #25
    Join Date
    Apr 2016
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    can somoene pls help me it doesnt work and im using an clan wars ns bot i have teamviewer
    Last edited by yogi; 04-18-2016 at 08:37 PM.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •