• Hi Guest! To get rid of ads on the page, please consider donating through user upgrades or other methods.

AHK - Skip cutscenes

Kura

Cricket
Member
Mega overhaul: Fixed up the script to let it be 100% (for the length of my testing, your results may vary) consistent. Either build the script with the updated code below, or download the zip file.

Saw this thread a while back, decided today while farming for mats to write up a simple script to run in the background so I don't have to skip cutscenes all the time.

1. Either copy/paste the code below into notepad and save as .ahk or download the attachment below the post.
2. Make sure the escape.png that's attached below is in the same directory as the script.
3. Run the script, either as is or compile and run it. Make sure it's running as admin so the ControlSend function works properly in game.
4. ???
5. Profit

Code:
SetTitleMatchMode=2
WinGet, client, ID, Blade & Soul
CoordMode, Pixel, Screen
WinActivate, ahk_id %client%
MouseGetPos,,, WinID, WinCon
SetControlDelay 0


Loop
{
    ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *50 escape.png
    if ErrorLevel = 0
    {
        ControlSend, ahk_parent, {Escape}, ahk_id %WinID%
        sleep 3000
    }
    else if ErrorLevel = 1
    {
    sleep 100
    }
    else if ErrorLevel = 2
    {
    MsgBox Cannot open image or bad format
    ExitApp
    }
}
return
 

Attachments

Last edited:

cupid

Forgiving
Staff member
Moderator
Member
:bnscool: I find your advice to do not compile it quite interesting.

With almost everybody who had issues with it, I've told them to compile and it works.

Something weird I saw in your code...
You have this line:
Code:
sleep, 3000
But then you have this:
Code:
Sleep 100
Is this intentional?
Because the syntax is different.

Also, can't the script be slightly modified to use any image?
I actually suck at AutoHotkey, so, forgive my stupid questions.
 

Kura

Cricket
Member
Yeah, it seems to be different from person to person. Personally I’ve always crashed when running compiled versions, but coulda been something different causing it.

And yeah they do the same function, just different ways of typing it out. Was a rush project lol.

Yes, have it point to any image you want (skill icon if you like for instance) and if it shows on the screen, it’ll hit the button in the brackets. So remap the button from escape to say tab or something if you get stunned and it reads the icon, it’ll use your tab escape for you.
 

cupid

Forgiving
Staff member
Moderator
Member
This is PURE SPECULATION WITHOUT ANY HARD EVIDENCE AT ALL

What I think that may be happening is the difference in syntax that's causing warnings.
If the compiled version tries to attach to a debugger to present the messages, then it can cause the crash.

Don't know if this makes sense or not.


I kinda know how the function works.
One tip: instead of the person taking the screenshot, how about the person resizing the image?
If it is a PNG image, it works a bit better.

I don't mind doing some of it, but not always and not for all resolutions.
 

Kura

Cricket
Member
Mhm that could make sense, I’ll have to do more testing once I’m back home from work tonight anyways to make a better release.

This was just so I could have something out that was working for me at least and maybe some others. Resizing should work just fine too probably, but can’t guarantee. Gotta figure out how to make it focus on just the escape prompt from the bottom right rather than read the whole screen.
 

cupid

Forgiving
Staff member
Moderator
Member
https://www.autohotkey.com/docs/commands/ImageSearch.htm

You might be interested in that link.

I could write some pseudo-code based in the syntax of AutoHotkey.
Sadly, I never got it to work for me, but can give a try to get AutoHotkey to work.
--- Merged ---
https://autohotkey.com/board/topic/26695-convert-image-to-ahk-code/

https://autohotkey.com/board/topic/13660-include-bitmaps-in-your-scripts/

There are other examples of embed images into AutoHotkey scripts, but I don't know if this will help :/
 

Kura

Cricket
Member
Yeah, I tried to look at those ways to embed the image into the script itself, but it seemed overly complicated/my attention span ran out due to my work load this week. So I'm just gonna release the updated version that requires the user to keep the image file in the same folder with the script to run.
 

cupid

Forgiving
Staff member
Moderator
Member
I've done some homework and I tried a few things.
  1. Your image can be optimized.
    This is what I came up with (39x39 px):
    esc.png

    This was taken from the game assets, in C:\Program Files (x86)\NCSOFT\BnS\contents\Local\NCWEST\ENGLISH\CookedPC\00015590.upk
    Object name: SkipEnable
    Original .tga file inside the zip file.

    I've edited is so only this piece is available:
    upload_2018-11-20_22-53-19.png

  2. The icon is within an area of 94x42 pixels, on the bottom-right corner.

    Instead of searching from 0,0 to %A_ScreenWidth%, %A_ScreenHeight%, you can just search for a specific area.
    This reduces the cpu load a lot, and BnS is very CPU heavy.

    area.png

    ^ That was from a screenshot.
    The red-ish area is to show the spacing I'm going for when optimizing, which is 68x16px (not precise in the image).

    For the image, I'm going for a search area of 25x25, despite the image being 39x39.
    Which sucks, since it means that the image is being resized....... WHY!?!?!?!!?!??!?!!?!?!?!?!?!?!?!?!?!

    Anyway, I've resized my image to 24x24 and the search area is 24x24:
    esc_resized.png

    With this, the search starts at %A_ScreenWidth%-69, %A_ScreenHeight%-40 and ends at %A_ScreenWidth%-45,%A_ScreenHeight%-16.

  3. This didn't worked...

    It did nothing ...
    I need more testing :/
 

Attachments

Noir

Bamboo Warrior
Member
thank you for this SUPER UBER useful Script ! saves a lot of trouble pressing ESC every single time be it in story or in dungeon/raids!
one small wish if it's possible to realise is : is it possible to reduce cpu usage for the script? it uses about 6-8% in the background for me
 
Top Bottom