Jump to content
Janilabo

[Project RSC] CowKiller

Recommended Posts

^ That was for the Line 146 error

 

{$IFDEF SCAR336_UP}  
 var
 {==============================================================================]   
   Created: October 27th, 2012.
   Updated: October 28th, 2012.
   Contributors: Janilabo
   Explanation:                    
 [==============================================================================}
   PRSC_StoredOW: LongWord;  
{$ENDIF}

procedure PRSC_ClientSetup;
{==============================================================================]   
 Created: October 27th, 2012.
 Updated: October 28th, 2012.
 Contributors: Janilabo
 Explanation:                    
[==============================================================================}
var
 t: Integer;
begin
 PRSC_Client := TSCARWindowClient(GetClient);
 PRSC_Client.Update;                                   
 PRSC_Client.Activate;
 {$IFDEF SCAR336_UP}
   PRSC_StoredOW := GetOuterWindow(PRSC_Client.Handle);     
   t := GetSystemTime;
   repeat
     Wait(100); 
   until (((GetSystemTime - t) > 2000) or (GetActiveWindow = PRSC_StoredOW));
 {$ELSE}
   Wait(2000);
 {$ENDIF}   
end;

function PRSC_ValidClient: Boolean;
{==============================================================================]   
 Created: October 7th, 2012.
 Updated: October 28th, 2012.
 Contributors: Janilabo
 Explanation:                    
[==============================================================================}
var
 w, h: Integer;
begin
 PRSC_Client.Update;
 if PRSC_Client.Exists then
 begin
   {$IFDEF SCAR336_UP}              
     if (GetActiveWindow <> PRSC_StoredOW) then
       Exit;                                       
   {$ENDIF}                         
   GetWindowSizeEx(PRSC_Client.Handle, w, h, True); 
   if (InRange(w, 510, 513) and InRange(h, 338, 343) and (GetWindowClass(PRSC_Client.Handle) = 'SunAwtCanvas')) then
     Result := MSSL_BoxInBox(PRSC_Client.InputArea, GetWindowBox(GetDesktopWindow));
 end;                          
end;

 

The line 20 error was here, on Client.scar

Edited by moaL
Link to comment
Share on other sites

^ That was for the Line 146 error

 

{$IFDEF SCAR336_UP}  
 var
 {==============================================================================]   
   Created: October 27th, 2012.
   Updated: October 28th, 2012.
   Contributors: Janilabo
   Explanation:                    
 [==============================================================================}
   PRSC_StoredOW: LongWord;  
{$ENDIF}

procedure PRSC_ClientSetup;
{==============================================================================]   
 Created: October 27th, 2012.
 Updated: October 28th, 2012.
 Contributors: Janilabo
 Explanation:                    
[==============================================================================}
var
 t: Integer;
begin
 PRSC_Client := TSCARWindowClient(GetClient);
 PRSC_Client.Update;                                   
 PRSC_Client.Activate;
 {$IFDEF SCAR336_UP}
   PRSC_StoredOW := GetOuterWindow(PRSC_Client.Handle);     
   t := GetSystemTime;
   repeat
     Wait(100); 
   until (((GetSystemTime - t) > 2000) or (GetActiveWindow = PRSC_StoredOW));
 {$ELSE}
   Wait(2000);
 {$ENDIF}   
end;

function PRSC_ValidClient: Boolean;
{==============================================================================]   
 Created: October 7th, 2012.
 Updated: October 28th, 2012.
 Contributors: Janilabo
 Explanation:                    
[==============================================================================}
var
 w, h: Integer;
begin
 PRSC_Client.Update;
 if PRSC_Client.Exists then
 begin
   {$IFDEF SCAR336_UP}              
     if (GetActiveWindow <> PRSC_StoredOW) then
       Exit;                                       
   {$ENDIF}                         
   GetWindowSizeEx(PRSC_Client.Handle, w, h, True); 
   if (InRange(w, 510, 513) and InRange(h, 338, 343) and (GetWindowClass(PRSC_Client.Handle) = 'SunAwtCanvas')) then
     Result := MSSL_BoxInBox(PRSC_Client.InputArea, GetWindowBox(GetDesktopWindow));
 end;                          
end;

 

The line 20 error was here, on Client.scar

Hey moaL, which version of SCAR Are you using? Which Windows version?

 

Make sure, you are using webclient. Standalone client is problematic..

Also, make sure that you capture ONLY the applet area of ProjectRSC. So, drag that crosshair from SCAR Divi in middle of ProjectRSC screen.

 

-Jani

 

\

 

Adding food,

 

Step 1. At the top add a new variable for your food, in this case bmpNEWFOOD

var
 alarmTM, lastAttackTM, fatiguePercent: Integer;
 bmpSwordfish, bmpTuna, bmpNEWFOOD, bmpLobster: TSCARBitmap;

 

Step 2

Add a new free step on script terminate.

 

procedure ScriptTerminate;
begin
 PlaySound(ScriptPath + 'empty.wav');
 PRSC_RotateCamera(rcd_Nil3);  
 bmpSwordfish.Free;
 bmpLobster.Free;
 bmpTuna.Free;
 bmpNEWFOOD.Free;
 MSSL_Unsetup; 
 SetLength(cowColors, 0);
end;

 

Step 3

add another step to the FoodFound function. Notice i changed 2 to a 3 in the for line. (4 options of food)

 

for i := 0 to 3 do
     begin 
       PRSC_Wait(0); 
       case i of
         0: b := bmpSwordfish.Clone;
         1: b := bmpLobster.Clone;
         2: b := bmpTuna.Clone;
         3: b := bmpNEWFOOD.Clone;
       end;  

 

Step 4

add the newfood bitmap to the scriptsetup function

 

bmpNEWFOOD := TSCARBitmap.Create('STRING HERE'); 

 

get the string from the bitmap selector in scar

Hey turner, thanks a lot for helping laive!

On a side note, I have added all fishes + meat to the next version. The only thing I am missing right now, is that moderator/admin detection.. But I need to get crown of a [Player] Moderator. :(

Edited by Janilabo
Link to comment
Share on other sites

Hey moaL, which version of SCAR Are you using? Which Windows version?

 

Make sure, you are using webclient. Standalone client is problematic..

Also, make sure that you capture ONLY the applet area of ProjectRSC. So, drag that crosshair from SCAR Divi in middle of ProjectRSC screen.

 

-Jani

 

Windows 7, Scar Divi 3.35.

 

Was using client but using webclient now and getting the exact same problems.

Link to comment
Share on other sites

Windows 7, Scar Divi 3.35.

 

Was using client but using webclient now and getting the exact same problems.

Hello moaL, can you get me some client information (so I can figure out what is/could be wrong)

 

Do this:

-Open SCAR Divi

-View => Show Target Client

-Go to Target Client and read what these values say (I post mine as example, show me yours): ImageBox: (0, 0, 511, 338) and ClassName: SunAwtCanvas

 

Then I can help you more. :)

 

Regards,

-Jani

Link to comment
Share on other sites

Hey moaL, so the problem is that you didn't drag SCAR Divi's crosshair to your client.

 

See this ancient photo, of dragging crosshair to client:

 

http://www.kaitnieks.com/files/SCARGUIDE/ScreenHunter_036.gif

 

Use that to your Project RSC. :)

 

I already did that, the stuff I quoted to you was when I just opened it up and gave the values without me setting the crosshair up.

 

Fixed now but I had to do something else.

 

Thanks Buddy.

Link to comment
Share on other sites

I already did that, the stuff I quoted to you was when I just opened it up and gave the values without me setting the crosshair up.

 

Fixed now but I had to do something else.

 

Thanks Buddy.

No problem, glad you got the script working! :)

 

EDIT: New version out!

Edited by Janilabo
Link to comment
Share on other sites

Ah, I noticed something was different.
Yeah, they broke all of my scripts with that color changing update, but I am making a comeback now. SCAR Divi 3.37 version has got plenty of TPA power for me to use, so I can keep good speed with scripts even if they add even crazier color changing in Project RSC. :P

 

Just takes some time to optimize things. :) I will be updating these *Killers soon aswell.

 

By the way, I added a script's Current Status to the main post, that shows the status of the script currently - this is broken and needs updating.

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...