Jump to content
Wanted

[1-4Mil/ph] OSI Sudoku Solver

Recommended Posts

SortATPABySize only has a single parameter...
Unfortunately if you change the problem line in the script to a single parameter (ATPA) it still gives the incorrect number of parameters error. This is what I was referring to.

 

Here is just that function dropped into an empty script. It compiles. That exact same function gives an "invalid # of parameters" when compiled as part of the full script.

 

Note he is using SortATPASize (which takes 2 params) but you get the exact same effect with SortATPABySize (which takes 1 param). (Which I added to test and commented out) All of which suggests it is not a problem with the script or rather perhaps the script surfacing an obscure issue with SCAR. Regardless it is enough to drive you round the bend. I lost track of the number of times I bumped into this "feature" when trying to write version 2 of my superheater. Drove me absolutely crazy and I could never come up with a test script so I could file a bug report.

 

Apologies Wanted if I shouldn't have quoted your script here.

 

[sCAR]program New;

 

{$DEFINE RS2}

{$DEFINE OSI_Color_Anti_Randoms}

//{$DEFINE SMART} // Comment out to disable SMART

 

{$I OSI\OSI.scar}

{$I OSI\Divi\Misc\Debug.scar}

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function TalkToAli: Boolean;

Contributors: Wanted

Description: Initiates conversation with Ali.

Date Created: Feburuary 5th, 2012. By Wanted. RS2 Build 700.

Last Modification: Feburuary 5th, 2012. By Wanted. RS2 Build 700.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function TalkToAli: Boolean;

var

ATPA: T2DPointArray;

TPA: TPointArray;

P: TPoint;

begin

Result := False;

ColorToleranceSpeed(2);

SetColorSpeed2Modifiers(0.09, 0.25);

FindColorsTolerance(TPA, 9662030, MSX1, MSY1, MSX2, MSY2, 11);

SetColorSpeed2Modifiers(0.2, 0.2);

ColorToleranceSpeed(1);

ATPA := SplitTPA(TPA, 8);

if (Length(ATPA) < 1) then

Exit;

SortATPASize(ATPA, True); // This now compiles (does not in full script)

// SortATPABySize(ATPA); // as does this (does not in full script)

P := MiddleTPA(ATPA[0]);

MMouse(P.X, P.Y, 0, 0);

if (not (IsUpTextMulti(['to A', 'Ali', 'li M', 'orrisa', 'risane']))) then

Exit;

GetMousePos(P.X, P.Y);

Mouse(P.X, P.Y, 0, 0, True);

Result := True;

end;

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

begin

SetUpOSI;

TalkToAli;

end.[/sCAR]

Edited by Bixby Sayz
Link to comment
Share on other sites

When I compiled this is threw the error from here 452 : " if (not (EnterBankPin(Players[CurrentPlayer].Pin, True))) then" notice I added the True (see this thread http://forums.scar-divi.com/showthread.php?1212-IMPORTANT-Tab-Screen-Check-Restructure-UPDATE-YOUR-SCRIPTS-NOW-OSI-Dev-3-30-12&highlight= )

 

My SCAR compiles and maps the error correctly, however yours did not.

Link to comment
Share on other sites

They've all been fixed for me since they were fixed last, which was shortly after the bug was introduced in the first place. I didn't think this issue was around any more at all.

 

Some of my tests for it are still failing, though the tests could be wrong obviously, I need to check...

Link to comment
Share on other sites

yes is there a way to fix line 647 i read all of the post from page one to here and i see thet their is now a bug so grrrrr how do we fix it

 

I honestly dont know. We discussed it throughout this thread, but the problem was never located or fixed. The best idea i can give to you is to try to write your own scripts. If you need help we will be glad to help you learn to write scripts.

 

~ Shadowrecon

Link to comment
Share on other sites

you can fix the line 647 error pretty easily, go to line 618 where the code is

 

if (not (EnterBankPin(Players[CurrentPlayer].Pin))) then

 

change it to

 

if (not (EnterBankPin(Players[CurrentPlayer].Pin, True))) then

 

after that it works great, once you fix it not clicking the green arrows as well ( im not going to spoonfeed it all, its in the first few pages )

my only problem with it at the moment is there's hardly any profit at all, I actually lose money pretty often

Link to comment
Share on other sites

you can fix the line 647 error pretty easily, go to line 618 where the code is

 

if (not (EnterBankPin(Players[CurrentPlayer].Pin))) then

 

change it to

 

if (not (EnterBankPin(Players[CurrentPlayer].Pin, True))) then

 

after that it works great, once you fix it not clicking the green arrows as well ( im not going to spoonfeed it all, its in the first few pages )

my only problem with it at the moment is there's hardly any profit at all, I actually lose money pretty often

 

 

Wow, the error is finally located! =p The problem is runes have dropped in price so much since the loadstone update =/

Link to comment
Share on other sites

yeah I noticed the severe drop in rune prices, I did this with 4m exactally last night and ended up with 3.8m. what kind of crap is that :/ I hope rune prices go up again, this could be super profitable!

 

your all welcome for the spoonfeed on that one, the information to fix it is in this post but its super confusing and hard to find.. so I just simplified it lol

Link to comment
Share on other sites

This script needs a lot of updating to be compatible with 3.35. I don't know if any of the scripts have been updated yet. (I know I am guilty of not updating mine yet)

 

For kicks had a go at updating this script to 3.35. Not a lot of joy. Into the "fun" of parser throwing an error on the wrong line and left guessing where the actual error is. fuuuuuuuun.

 

Edit: I have it compiling with the latest SCAR and OSI includes. Haven't run it to see if it still does what it is supposed to. Have to check with Wanted before posting it. It is his script after all.

Edited by Bixby Sayz
Link to comment
Share on other sites

This script needs a lot of updating to be compatible with 3.35. I don't know if any of the scripts have been updated yet. (I know I am guilty of not updating mine yet)

 

For kicks had a go at updating this script to 3.35. Not a lot of joy. Into the "fun" of parser throwing an error on the wrong line and left guessing where the actual error is. fuuuuuuuun.

 

Edit: I have it compiling with the latest SCAR and OSI includes. Haven't run it to see if it still does what it is supposed to. Have to check with Wanted before posting it. It is his script after all.

 

Just make a pull request on the git, he would have to approve the edit.

Link to comment
Share on other sites

Lost my copy I had working so I redid it. Got it compiling, but the initialization is not finding the client window. Wondering if I missed something.

 

I replaced this:

[sCAR] {$IFNDEF SMART}

FindWindowBySize(RSPW, RSPH);

WaitRR(500, 750);

ActivateClient;

{$ENDIF}

[/sCAR]

 

with this:

[sCAR] {$IFNDEF SMART}

Windows := FindWindowsBySize(GetDeskTopWindow, RSPW, RSPH, False);

if (Length(Windows) < 1) then

TerminateScript;

SetClient(TSCARWindowClient.Create(Windows[0])).Free;

WaitRR(500, 750);

GetClient.Activate;

{$ENDIF}

[/sCAR]

 

Compiles fine but doesn't find the RS window.

Link to comment
Share on other sites

Lost my copy I had working so I redid it. Got it compiling, but the initialization is not finding the client window. Wondering if I missed something.

 

I replaced this:

[sCAR] {$IFNDEF SMART}

FindWindowBySize(RSPW, RSPH);

WaitRR(500, 750);

ActivateClient;

{$ENDIF}

[/sCAR]

 

with this:

[sCAR] {$IFNDEF SMART}

Windows := FindWindowsBySize(GetDeskTopWindow, RSPW, RSPH, False);

if (Length(Windows) < 1) then

TerminateScript;

SetClient(TSCARWindowClient.Create(Windows[0])).Free;

WaitRR(500, 750);

GetClient.Activate;

{$ENDIF}

[/sCAR]

 

Compiles fine but doesn't find the RS window.

 

In this case you have to set Recursive to True as the RS client window is located in the browser. The browser is a child window of the desktop, but the RS window is a child window of the browser, so it has to do a recursive search to find it.

Link to comment
Share on other sites

May just leave the check out and simply activate whatever the active client is. Easier.

 

Just did a test script that simply finds all windows and displays their dimensions: none of them match the desired dimensions; not even the RS client window. Speaking of which how do you search for all windows regardless of title: pass in '' perhaps?

 

Edit: Got it. Searching by window size fails to find it. Had to search for blank window title (to get all windows) and then iterated through until found one that matched the size: which turned out to be +50 pixels in the Y direction (my that sounds familiar).

 

Script compiles, but I still don't have a char that could test this to see if it actually works. About to head out to a house party for a bit. Might do the required quest(s) when I get back so I can test it.

Edited by Bixby Sayz
Link to comment
Share on other sites

I to am getting familiar with git. Am I getting this right on this pull or not? D:

 

Put a fork in it!? Lols I couldn't resist

 

https://github.com/OSI1/OSI1/pull/5

 

I've merged you request into OSI, and also Bixby's which I missed apparently. Was expecting an email or something :P I'll upload the changes to the main repository soon. Make you you pull the changes into your local clone, my video explains how to do it.

Link to comment
Share on other sites

I've merged you request into OSI, and also Bixby's which I missed apparently. Was expecting an email or something :P I'll upload the changes to the main repository soon. Make you you pull the changes into your local clone, my video explains how to do it.

 

Lol alright...I think there is a github app for phones. Then just turn on notifications for it xD.

 

I'll email you for now on. Yes I watched your video! It was amazing, that tutorial!

 

RIP Pull 5

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
  • Create New...