ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Mindoza on May 02, 2010, 04:59:43 AM

Title: Ultra fast bolt basher!
Post by: Mindoza on May 02, 2010, 04:59:43 AM
Hiya, ive finally started hardcore research on scripting, mainly due to having no girlfriend to occupy my time and nag me, and also im currently unemployed hah.

Recently ive been running a razor macro with 4 separate macro's set to hotkeys and hitting them manually.

They are in essense:

Double click NPC.
Accept Quest.
Toggle Quest Item.
Receive Reward.

Now youre probably wondering what does this have to do with scripting? Well this process involves me spamming the npc until i get the lethal darts quest, then hitting the 3 keys afterward when i get the correct type.

Id like to make a simple script to basically do this job for me, to double click until it hits lethal darts. Then activate the other 3 macros. Like a razor/script hybrid.

If i could be pointed in the right direction towards a possible resource specifically describing how i can integrate key strokes in a script to manipulate razor macro's it would be much appreciated! Also, how exactly i would go about defining a rule to stop on a specific quest?
Title: Re: Ultra fast bolt basher!
Post by: UOMaddog on May 04, 2010, 10:25:44 PM
The only really difficult part of that is the first step: Spamming until you get the correct quest. Unforunately it has to be done with an OCR-type script (Optical Character Recognition). The best one that most people use is KalOCR. If you use that, then the rest is easy!
Title: Re: Ultra fast bolt basher!
Post by: Mindoza on May 06, 2010, 10:53:38 AM
Think im a little over my head! Ive figured out how to set keys, and have written a dodgy first script to try and create rules on accepting certain quests and disregarding others but i think i need to read up more! hah.

This is the script, you will probably look at it and think, oh my! hah. It doesnt work. First attempt though. Will read up and undoubtedly realise mistakes.

F5 = Double Click NPC
F6 = Accept Quest
F7 = Toggle Quest Status
F8 = Receive Reward
Code: [Select]
set #lpc 1000
set %kalocr #curpath , kalocr.txt

Sub CheckQuest
wait 5
call %kalocr GetMLQInfo QuestOffer #contposx #contposy
If %1 = A , #spc , Simple , #spc , Bow
Key F5
If %1 = Lethal , #spc , Darts
Gosub Quest
If %1 = Ingenious , #spc , Archery, , #spc , Part , #spc , I
Key F5
If %1 = Ingenious , #spc , Archery, , #spc , Part , #spc , II
Key F5
If %1 = Ingenious , #spc , Archery, , #spc , Part , #spc , III
Key F5
If %1 = Stop , #spc , Harping, , #spc , On , #spc , Me
Key F5
Gosub Checkquest

Sub Quest

Key F6
}
Wait 1

Key F7
}
Wait 1

Key F8
}
Wait 1

Gosub Checkquest
Title: Re: Ultra fast bolt basher!
Post by: TrailMyx on May 06, 2010, 10:55:51 AM
Has kalocr been updated since they changed the quest info from the last patch?
Title: Re: Ultra fast bolt basher!
Post by: Scrripty on May 06, 2010, 10:57:09 AM
You could always use my poor mans ocr and look for specific points on the menu with it to define your "search."  And when it comes back #true, you found it. :)  It's in my sig named PM OCR.