Author Topic: Script Suggestion for anyone up to the task!  (Read 2734 times)

0 Members and 1 Guest are viewing this topic.

Offline UOMaddogTopic starter

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Script Suggestion for anyone up to the task!
« on: December 14, 2009, 07:02:09 PM »
0
So, I was trying to whip up a quick "pulp to blank scroll" script for a friend, and I remember hearing about a script that had support for all the crafting gumps that you call like this:

CraftItem %tooltype A B

where:
%tooltype = type of tool you're crafting with
A = category to click (1=LAST TEN, 2 through 10=each category on that particular menu)
B = selection to click (1-10=first page, 11-20=second page (if there is one), etc; the script handles clicking "next page" until it gets to the right one)

However, the person who wrote this script made it rely on ANOTHER script that handles the gumps. Currently, it doesn't seem to work if you pick "10" as the item selection. I imagine this may have to do with poor coding or the updates to the crafting gumps.

Sooooo.....Who's up for the task of writing one from scratch that has it's own gump handling and it up-to-date with all the current menus?! I simply do not have the time to do it myself, but I'd be more than happy to test and offer guidance!

I know someone out there is bored and looking for an awesome project..... ;D
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline NObama

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Script Suggestion for anyone up to the task!
« Reply #1 on: December 14, 2009, 07:16:18 PM »
0
Someone explain the process for making pulp and I might take it on...

 :)

(PM me, or I might miss your reply)
« Last Edit: December 14, 2009, 07:19:28 PM by NObama »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Script Suggestion for anyone up to the task!
« Reply #2 on: December 14, 2009, 08:04:19 PM »
0
I have such code... its on my list to seperate such crafting code out into a seperate callable sub .. along with other such module functions... unfrotunately i probably wont get to this until after the new years...

Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Script Suggestion for anyone up to the task!
« Reply #3 on: December 14, 2009, 09:43:53 PM »
0
Give it A Whirl, Just hit play and follow the Instructions. Nothing Fancy, but Should be Fast!! Just does it Until You run out of Bark Fragments :)


Code: [Select]
;=======================================================
; Script Name: MWinc. Useful Subs
; Author: MWinc.
; Version: 1.0
; Client Tested with: Baja
; EUO version tested with: 132
; Shard OSI / FS:  OSI
; Revision Date:
; Public Release:
; Purpose: Everything I will Ever Need
;=======================================================
; How To Use MY buy Sub
; Gosub Mwinc_Buy "Vendor" "Item Type/Types" Quantity
;------------------
; Vendor Selection
;------------------
; Tailor
; Blacksmith
; Jeweler
; Provisioner
;



;================================================================
; My setup Stuff
set %Bod_Type EYM
set %Craftmenu 530_507
set %fletchingtool UFG
set %tailoringtool HAG
set %alchemytool RQF
set %tinkeringtool JTL
set %blacksmithingtool OBG_FBG_TLH
set %cookingtool OGG_DND_BCG
set %carpentrytool BIG_AIG_EGG_AGG_ZHG_CGG_CIG_IGG_WFG_KGG
set %ScribeTool PBG
; gosub craft "Tool Type" , " setting " , "categorie" , " Page " , " number Down " ,
; gosub makelast "Tool Type"
; gosub resource "item" , Min , Max
;=====================================================================
set #targcurs 1
Display Target Water Source
target 20
WHile #targcurs = 1
wait 1
set %Water_Source #Ltargetid
Display Target Secure Container
set #targcurs 1
while #targcurs = 1
wait 1
set %Secure #ltargetid
set #Lobjectid #Ltargetid
Event macro 17 0
while #Contid <> %Secure
wait 1
contpos 0 0
wait 20


Gosub Craft Cooking N/A 2 2 10
Main:
Gosub Resource NWS 1 20
Gosub Check_Pitcher
Finditem EUO C_ , #Backpackid
if #findstack > 50 || #Findcnt > 1
{
exevent drag #findid #findstack
Exevent dropc %Secure
wait 30
}
Gosub MakeLast Cooking
goto main

Sub Check_Pitcher
Finditem VBM C_ , #Backpackid
if #findcnt > 0
Return
Finditem WYF C_ , #backpackid
if #findcnt < 1
{
display NO water PItcher
halt
}
Event property #findid
if Empty in #property && Nearly Notin #property
{
set #lobjectid #findid
event macro 17 0
target 20
set #ltargetid %Water_Source
set #Ltargetkind 1
Event macro 22 0
wait 20
}
Return



Sub Mwinc_Buy
Namespace Push
Namespace Local Mwinc_Buy_Variables
set !Human_Types HS_IS_XU_AV
Finditem !Human_Types G_6
set !Vendor N/A
if %1 = Tailor
{
set !Max_KeyWord 2
set !Key_Word1 Tailor
set !Key_Word2 Weaver
set !Bad_Word Guildmaster
}
if %1 = Blacksmith
{
set !Max_Keyword 2
set !Key_Word1 Blacksmith
set !Key_Word2 Armourer
set !Bad_Word N/A
}
if %1 = Provisioner
{
set !Max_Keyword 1
set !Key_Word1 Provisioner
set !Badword N/A
}
if %1 = Tinker
{
set !Max_Keyword 1
set !Keyword1 Tinker
set !Badword N/A
}
if %1 = Jeweler
{
set !Max_Keyword 1
set !Keyword1 Jeweler
set !Badword N/A
}
if %1 = Carpenter
{
set !Max_Keyword 1
set !Keyword1 Carpenter
set !Badword N/A
}
if %1 = Bowyer
{
set !Max_Keyword 1
set !Keyword1 Bowyer
set !Badword N/A
}
set !Buy_Type %2
set !Buy_Amount %3
For #findindex 1 #findcnt
{
if !Vendor <> N/A
Continue
event property #findid
if #findrep = 7
   {
   For !Number_Holder 1 !Max_Keyword
       {
       if !Key_Word . !Number_Holder in #property && !Bad_WOrd Notin #property && #Findid Notin !Used_Vendors
       set !Vendor #Findid
       }
   }
}
if !Vendor = N/A
{
set !Used_Vendors N/A
return
}
Repeat
{
Exevent Popup !Vendor
Gosub Cont_Timer 3 Contname Normal_Gump
}
Until #result = -1
Set !ClickX #contposx + 25
set !Clicky #contposy + 40
Click !CLickx !Clicky
Repeat
Gosub Cont_Timer 3 Contname Bill_Gump
Until #result = -1
set #lpc 1000 ; Speed Things up
set !Vendor_Status Bad
getshopinfo
While #shopcurpos < #Shopcnt
{
if #Shopitemtype in !Buy_Type || #Shopitemtype = !Buy_Type
{
set !clicky #contposy - 130
click #contposx !clicky D
setshopitem #shopitemid !Buy_Amount
set !Vendor_Status Good
}
set !clickx #contposx + 71
set !clicky #contposy - 16
click !clickx !clicky F
getshopinfo
}
set !clickx #contposx + 46
set !clicky #contposy + 206
click !clickx !clicky
wait 20
set #Lpc 10 ; Slow it back down
if !Vendor_Status = Bad
set !Used_Vendors !Used_Vendors , _ , !Vendor
Namespace Pop
Return

Sub Cont_Timer
Namespace Push
Namespace Local Mwinc_Cont_Timer
set !Time_Limit #scnt + %1
While !Cont_Check <> %3 && !Time_Limit > #scnt
{
set !Cont_Check # . %2
wait 5
}
if !Time_Limit <= #scnt
{
Namespace Pop
Return #False
}
Namespace Pop
Return #True

;==================================================
Sub recall
recall:
gosub Bookkeeper ;Clear
gosub Diagnostics Recall 0
set %jindexlimit #jindex
gosub health ;Clear
if #weight > %maxweight
{
set %Ground_Location 1
goto Drop_on_Ground
}
gosub position ; Clear
set #lobjectid %book
event macro 17 0
gosub bookgump ;Clear
if #Result <> Clear
return
gosub clicky ;Clear
gosub turnthepage ; Clear
click %page %y2
click %side %y3
;gosub Spellwait
if %hiding = yes
wait 40
gosub Hiding ;Clear
if %position_monitor = True
{
Gosub Positionmonitor ;Clear
if #result <> Clear
return
}
else
{
gosub Diagnostics Recallwait 0
wait %recallwait
gosub Scan ; Clear
if #result <> Clear
return
}
if %book = %homebook
goto drop
if #result <> Clear
return
if %book = %resourcebook
set %Current_Action Kill
if %Book = %Homebook
set %Current_Action Drop
wait 20
return
;===============================================
;=================================================================================================
; Recalling Subs
;=================================================================================================
;Sets the Page and Side Based on %Bookspot
sub turnthepage
if %book = %homebook
{
set %page %page1
set %side %leftpage
return
}
if %bookspot > 16
set %bookspot 1
set %this ( ( %bookspot + 1 ) / 2 )
set %page %page . %this
set %side %bookspot % 2
if %side > 0
set %side %leftpage
if %side = 0
set %side %rightpage
return
;================================================
; Sets Your current position To compare if you move
sub position
set %posx #charposx
set %posy #charposy
return
;================================================
; Checks to See if Your Position Changes
sub check
if %book = %homebook
{
finditem %secure
if #findcnt > 0
{
set %moved True
return clear
}
}
if %posx = #charposx && %posy = #charposy
{
set %moved False
return Clear
}
set %moved True
return clear
;================================================
; Checks Journal For Blocked Locations
sub scan
For %number 0 8
{
set %jindex #jindex - %number
scanjournal %jindex
if %jindex = %jindexlimit
return Clear
if something_is_blocking in #journal || That_location_is_blocked in #journal
   {
   if %book = %resourcebook
      {
      wait 200
      set %bookspot %bookspot + 1
      Return Recall
      }
   if %book = %homebook
      {
      if %bank = Yes
         {
         gosub bankwait
         if #contsize <> 180_240
            {
            set %book %homebook
            Return Recall
            }
         }
      }
   }
}
return Clear
;================================================
; Sets the Position For your clicking Based on Position
sub clicky
set %page1 #contposx + 135
set %page2 #contposx + 170
set %page3 #contposx + 205
set %page4 #contposx + 240
set %page5 #contposx + 305
set %page6 #contposx + 340
set %page7 #contposx + 375
set %page8 #contposx + 410
set %y2 #contposy + 195
set %leftpage #contposx + 135
set %rightpage #contposx + 295
if %recallmethod = Recall
set %y3 #contposy + 144
else
set %y3 #contposy + 180
return
;================================================
; Waits For Your Book To Open
sub bookgump
wait 10
gosub Diagnostics Book 0
set %Limit_Timer #Scnt + 2
while #contsize <> 452_236 && #Scnt < %Limit_Timer
wait 5
if %Limit_Timer < #Scnt
{
gosub Diagnostics Bookfail
Return Recall
}
return Clear
;==============================================
;===============================================
; Waits For A change In your Position over 7 seconds
sub Positionmonitor
set %moved False
gosub Diagnostics movement 0
set %Timer_Limit #scnt + 7
set #result Clear
While %Moved <> True && #Scnt < %Timer_Limit && #result = Clear
{
gosub check  ;Clear
gosub scan   ;Clear
wait 5
}
if #result <> Clear
Return #Result
if %Timer_limit <= #scnt
{
gosub Diagnostics Movementfail 20
Return Recall
}
return Clear
;===============================================
; Allows For INFINITE Book Usage PWNT!!!!
sub bookkeeper
set %Max_Rune %Max_Rune_ . %ResourceBook
if %bookspot <= %Max_Rune
return
set %bookspot 1
set %Keeper %keeper + 1
if %keeper > %bookie
set %keeper 1
set %ResourceBook % . Resourcebook . %keeper
set %book %resourcebook
return

;==============================================================================================

sub Drag_Drop
set %dropweight #weight
exevent drag %1 %2
exevent dropc %3
set %Time_Limit #scnt + 3
while #weight = %dropweight && %Time_Limit > #Scnt
wait 1
if #scnt >= %Time_limit
Return
wait 15
return
;=========================================================
;=========================================================
Sub repair
Finditem %1 G_2
if #findcnt < 1
return
set %ClickX #contposx + 285
set %CLicky #contposy + 354
Click %Clickx %CLicky
Target 80
set #Ltargetid %1
set #ltargetkind %2
Event macro 22 0
wait 20
return

Sub Open_Tool
Open_Tool:
gosub ToolEval %1
Finditem %tool C_ , #backpackid
if #findcnt < 1
gosub End OutOfTools
set #lobjectid #findid
if #contsize <> %craftmenu || #Lobjectid <> #findid
{
event macro 17 0
wait 10
}
gosub contsizewait %Craftmenu
if #result = Open_Tool
goto Open_Tool
if #result = Fail
return Fail
return Clear

sub craft
Gosub Open_Tool %1
if #result = Fail
return
gosub setting %2
gosub category %3
gosub page %4
gosub rownum %5
return

sub makelast
gosub tooleval %1
finditem %tool C_ , #backpackid
if #findcnt < 1
gosub end outoftools
set #lobjectid #findid
if #contsize <> %craftmenu
event macro 17 0
gosub contsizewait %craftmenu
set %xclick #contposx + 280
set %yclick #contposy + 450
click %xclick %yclick
wait 20
return

sub resource
Resource:
finditem %1 C_ , #backpackid
set %bagamount #findstack
if #findstack > %2
return
finditem %1 C_ , %secure
if #findcnt < 1
gosub end Resource
set %dragamount %3 - %bagamount
set %dropweight #weight
exevent drag #findid %dragamount
exevent dropc #backpackid
set %Time_Limit #scnt + 4
while #weight = %dropweight && #Scnt < %Time_Limit
wait 1
if %Time_Limit < #scnt
goto resource
wait 20
return

sub rownum
set %xclick #contposx + 235
set %starty #contposy + 50
set %yclick ( %starty + ( %1 * 18 ) )
click %xclick %yclick
wait 20
return

sub category
set %starty #contposy + 70
set %xclick #contposx + 30
set %yclick ( %starty + ( %1 * 20 ) )
click %xclick %yclick
gosub contsizewait %craftmenu
return

sub page
if %1 = 1
return
set %clicknum %1 - 1
set %xclick #contposx + 385
set %yclick #contposy + 270
click %xclick %yclick x %clicknum
return


sub Tooleval
if %1 = alchemy
set %Tool %Alchemytool
if %1 = fletching
set %tool %Fletchingtool
if %1 = blacksmithing
set %tool %blacksmithingtool
if %1 = tailoring
set %tool %Tailoringtool
if %1 = tinkering
set %tool %Tinkeringtool
if %1 = carpentry
set %tool %Carpentrytool
if %1 = cooking
set %tool %Cookingtool
set %tool2 %1
return

sub Contsizewait
set %Timer_limit #scnt + 4
finditem %Tool C_ , #Backpackid
if #findcnt < 1
return Fail
repeat
wait 1
until #contsize = %CraftMenu || %Timer_Limit < #scnt
if %Timer_Limit < #scnt
return Open_Tool
return Clear

sub setting
set %setting % . setting . %tool2
if %setting = %2
return
gosub contsizewait %craftmenu
set %clickx #contposx + 31
set %clicky #contposy + 372
click %clickx %clicky
wait 10
set %clickx #contposx + 230
if %2 = iron
set %clicky #contposy + 70
if %2 = Dullcopper
set %clicky #contposy + 90
if %2 = shadowiron
set %clicky #contposy + 110
if %2 = copper
set %clicky #contposy + 130
if %2 = bronze
set %clicky #contposy + 150
if %2 = gold
set %clicky #contposy + 170
if %2 = Agapite
set %clicky #contposy + 190
if %2 = Verite
set %clicky #contposy + 210
if %2 = Valorite
set %clicky #contposy + 230
if %2 = wood
set %clicky #contposy + 70
if %2 = oak
set %clicky #contposy + 90
if %2 = ash
set %clicky #contposy + 110
if %2 = yew
set %clicky #contposy + 130
if %2 = heartwood
set %clicky #contposy + 150
if %2 = bloodwood
set %clicky #contposy + 170
if %2 = Frostwood
set %clicky #contposy + 190
click %clickx %clicky
gosub Contsizewait %Craftmenu
set % , setting , %tool2 %2
wait 10
return

sub drop
drop:
Finditem %1 C_ , #backpackid
if #findcnt < 1
return
set %dropweight #weight
exevent drag #findid #findstack
exevent dropc %secure
set %Time_Limit #scnt + 4
while #weight = %dropweight && #Scnt < %Time_Limit
wait 1
if %Time_Limit < #scnt
{
gosub Backpack
goto Drop
}
wait 20
return



Sub End
if %1 = OutOfTools
Display You are Out of Tools
if %1 = Resource
Display Need more resources
halt

sub closegump
if #contsize <> %craftmenu
return
set %clickx #contposx + 50
set %clicky #contposy + 50
click %clickx %clicky R
wait 10
return

sub Backpack
Backpack:
event macro 9 7
wait 20
event macro 8 7
set %Timer_Limit #scnt + 2
while #contid <> #backpackid  && %Timer_Limit > #Scnt
wait 1
if %Timer_Limit <= #scnt
goto Backpack
contpos 700 525
wait 20
return
;==============================================================
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Script Suggestion for anyone up to the task!
« Reply #4 on: December 15, 2009, 12:45:07 PM »
0
Already have subs wrote that does that :P

It's in my multiskill crafting trainer.  Trains Fletching/Blacksmith/Tailoring/Tinkering/Carpentry/Bowcraft atm.  File sale/load using TM's subs.  Bank/house storage, trash/salvage/smelt/cut/unravel recycling.

I posted up a rough version of it months back, but I don't think anyone tried it so I figured there was no interest.  I'd gladly post it up as a project that anyone is welcome to help me work on.  I update it as I go & there's some things that need simplified, improved & added.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Script Suggestion for anyone up to the task!
« Reply #5 on: January 29, 2015, 09:44:16 AM »
0
OMGBurgers   Where did you post ur multiskill crafting trainer  can't seen to find it.   Looking to update my scroll making.

Tags: