1
Scripting Chat / Re: Vet
« on: August 02, 2017, 08:26:22 PM »
I wrote this while trying to learn to script, hopefully it still works!

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
made me lol+++++ very good thank your bro
I agree! The non-downloadable ones are the best!
sub findattack1
finditem %target G_15
if #findcnt < 1
event pathfind 6788 3444
{
if #finddist > 1
event pathfind #findx #findy #findz
gosub attackmob
}
until #findcnt < 1
return
;===================================================
; Script Name: SOT/PS Sorter
; Author: slyone
; Version: 1.1
; Public Release: 10-23-2009
; Revision Date: 4-7-2010
; Purpose: Sort your SOT's/PS's in Alphabetical Order
; Instructions: -Bag up a bunch of SOT's OR PS's to sort
; Note: The script doesn't differentiate
; b/w SOT's and PS's.
; -This script supports multiple bags
; of scrolls
; -Secure 10 empty BACKPACKS or POUCHES
; -Be close enough to all of your secures
; to drag and drop the scrolls on them
; -Press Play!
; Acknowledgements: Thanks to C2 and Mystre for the
; help on the routines and subs!
;===================================================
; Version 1.1 Updates: -Updated Instructions
; -Updated R bag
; -Fixed placement of Animal
; Lore and Arms Lore
;===================================================
;;;;;;;;;;;;;;setup procedure;;;;;;;;;;;;;;;;;;;;;;;
;sot scroll id
set %sotscroll TVH
;position for sot bag
set %sotbagposx 10
set %sotbagposy 10
;x positions for scrolls within backpacks
set %scrollposx1 50
set %scrollposx2 80
set %scrollposx3 110
set %scrollposx4 140
;y positions for scrolls within backpacks
set %scrollposy1 60
set %scrollposy2 100
;setup the backpacks
gosub bag_setup
sotsort:
;setup sot bag
set %sotbag DQQTGOD
wait 20
set #lobjectid %sotbag
event macro 17
wait 20
contpos %sotbagposx %sotbagposy
wait 10
;;;;;;;;;;;;;;sorting code;;;;;;;;;;;;;;;;;;;;;;;;;;
repeat
finditem %sotscroll C_ , %sotbag
wait 20
for #findindex 1 #findcnt
{
event property #findid
;seperate scrolls into 10 bags
;bag 1
if animal in #property
{
gosub checkif lore %bag1 %scrollposx3 %scrollposy1
gosub checkif taming %bag1 %scrollposx4 %scrollposy1
}
gosub checkif alch %bag1 %scrollposx1 %scrollposy1
gosub checkif anat %bag1 %scrollposx2 %scrollposy1
; moved animal lore to if statement
; moved animal taming to if statement
gosub checkif arms %bag1 %scrollposx1 %scrollposy2
gosub checkif archer %bag1 %scrollposx2 %scrollposy2
;bag 2
gosub checkif begging %bag2 %scrollposx1 %scrollposy1
gosub checkif black %bag2 %scrollposx2 %scrollposy1
gosub checkif fletching %bag2 %scrollposx3 %scrollposy1
gosub checkif bushido %bag2 %scrollposx4 %scrollposy1
;bag 3
gosub checkif camp %bag3 %scrollposx1 %scrollposy1
gosub checkif carpentry %bag3 %scrollposx2 %scrollposy1
gosub checkif carto %bag3 %scrollposx3 %scrollposy1
gosub checkif chiv %bag3 %scrollposx4 %scrollposy1
gosub checkif cook %bag3 %scrollposx1 %scrollposy2
;bag 4
gosub checkif detect %bag4 %scrollposx1 %scrollposy1
gosub checkif disco %bag4 %scrollposx2 %scrollposy1
gosub checkif intelligence %bag4 %scrollposx3 %scrollposy1
;bag 5
gosub checkif fencing %bag5 %scrollposx1 %scrollposy1
gosub checkif fishing %bag5 %scrollposx2 %scrollposy1
gosub checkif focus %bag5 %scrollposx3 %scrollposy1
gosub checkif foren %bag5 %scrollposx4 %scrollposy1
gosub checkif glass %bag6 %scrollposx1 %scrollposy2
;bag 6
gosub checkif healing %bag6 %scrollposx1 %scrollposy1
gosub checkif herd %bag6 %scrollposx2 %scrollposy1
gosub checkif hiding %bag6 %scrollposx3 %scrollposy1
gosub checkif imbuing %bag6 %scrollposx4 %scrollposy1
gosub checkif inscription %bag6 %scrollposx1 %scrollposy2
gosub checkif item %bag6 %scrollposx2 %scrollposy2
gosub checkif lock %bag6 %scrollposx3 %scrollposy2
gosub checkif lumber %bag6 %scrollposx4 %scrollposy2
;bag 7
gosub checkif mace %bag7 %scrollposx1 %scrollposy1
gosub checkif mage %bag7 %scrollposx2 %scrollposy1
gosub checkif mason %bag7 %scrollposx3 %scrollposy1
gosub checkif meditat %bag7 %scrollposx4 %scrollposy1
gosub checkif mining %bag7 %scrollposx1 %scrollposy2
gosub checkif music %bag7 %scrollposx2 %scrollposy2
gosub checkif myst %bag7 %scrollposx3 %scrollposy2
;bag 8
gosub checkif necro %bag8 %scrollposx1 %scrollposy1
gosub checkif ninji %bag8 %scrollposx2 %scrollposy1
gosub checkif parry %bag8 %scrollposx3 %scrollposy1
gosub checkif peace %bag8 %scrollposx4 %scrollposy1
gosub checkif poison %bag8 %scrollposx1 %scrollposy2
gosub checkif provo %bag8 %scrollposx2 %scrollposy2
gosub checkif remove %bag8 %scrollposx3 %scrollposy2
gosub checkif resist %bag8 %scrollposx4 %scrollposy2
;bag 9
gosub checkif snoop %bag9 %scrollposx1 %scrollposy1
gosub checkif spellweav %bag9 %scrollposx2 %scrollposy1
gosub checkif spirit %bag9 %scrollposx3 %scrollposy1
gosub checkif stealing %bag9 %scrollposx4 %scrollposy1
gosub checkif stealth %bag9 %scrollposx1 %scrollposy2
gosub checkif sword %bag9 %scrollposx2 %scrollposy2
;bag 10
gosub checkif tact %bag10 %scrollposx1 %scrollposy1
gosub checkif tailor %bag10 %scrollposx2 %scrollposy1
gosub checkif taste %bag10 %scrollposx3 %scrollposy1
gosub checkif throw %bag10 %scrollposx4 %scrollposy1
gosub checkif tinker %bag10 %scrollposx1 %scrollposy2
gosub checkif track %bag10 %scrollposx2 %scrollposy2
gosub checkif veter %bag10 %scrollposx3 %scrollposy2
gosub checkif wrest %bag10 %scrollposx4 %scrollposy2
}
until #charghost = yes || #findkind = -1
display yesno Are You Sorting Another Bag?
if #dispRes = yes
goto sotsort
display All Finished!
halt
;;;;;;;;;;;;;;subs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub bag_setup
;setup bag 1
set %bag1 NFOLEOD
wait 20
gosub openandmove 70 300 %bag1
;setup bag 2
set %bag2 OFOLEOD
wait 20
gosub openandmove 70 550 %bag2
;setup bag 3
set %bag3 YBULEOD
wait 20
gosub openandmove 250 300 %bag3
;setup bag 4
set %bag4 BCULEOD
wait 20
gosub openandmove 250 550 %bag4
;setup bag 5
set %bag5 SXTLEOD
wait 20
gosub openandmove 430 300 %bag5
;setup bag 6
set %bag6 GFOLEOD
wait 20
gosub openandmove 430 550 %bag6
;setup bag 7
set %bag7 NXTLEOD
wait 20
gosub openandmove 610 300 %bag7
;setup bag 8
set %bag8 OXTLEOD
wait 20
gosub openandmove 610 550 %bag8
;setup bag 9
set %bag9 DCULEOD
wait 20
gosub openandmove 790 300 %bag9
;setup bag 10
set %bag10 TXTLEOD
wait 20
gosub openandmove 790 550 %bag10
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub targets
set #targcurs 1
target
while #targcurs = 1
wait 0
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub dragndrop ;%1 = %dragid, %2 = %dropcontid, %3 = contposx_skill, %4 = contposy_skill
set %dragid %1
set %dropcontid %2
set %contposx_skill %3
set %contposy_skill %4
exevent drag %dragid
wait 15
exevent dropc %dropcontid %contposx_skill %contposy_skill
wait 10
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub checkif ;%1 = skill, %2 = bag for skill, %3 = contposx_skill, %4 = contposy_skill
if %1 in #property
{
gosub dragndrop #findid %2 %3 %4
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub openandmove ;%1 = contposx, %2 = contposy, %3 = secure
;open container
set #lobjectid %3
event macro 17
wait 20
;move
contpos %1 %2
wait 10
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set %homerunebook EOSSNOD
set %libraryrunebook JUSSNOD
set %homesecure KJHEFPD
set %ingots ENK
set %smithtool OBG
set %tinkertool JTL
set %donationnpc SKHWH
set %backpack UAJNZOD
set %ingotamount 500
main:
gosub openresourcebag
gosub getingots
gosub checktinkertools
gosub checksmithtools
gosub craftshields
gosub recalltonpc
repeat
{
gosub donate
}
#findcnt FIK C_ , #backpackid
until #findcnt <= 0
gosub recallhome
sub openresourcebag
set #lobjectid %homesecure
Event macro 17 0
wait 10
return
sub getingots
finditem ENK , %homesecure
exevent drag #findid %ingotamount
wait 10
Exevent Dropc #backpackid
wait 10
return
sub recalltonpc
event macro 15 31
target 50
set #ltargetid %libraryrunebook
event macro 22
wait 10
return
sub recallhome
event macro 15 31
target 50
set #ltargetid %homerunebook
event macro 22
wait 10
return
sub checktinkertools
repeat
#findcnt %tinkertool C_ , #backpackid
if #findcnt < 3
{
gosub crafttinkertools
}
finditem %tinkertool C_ , #backpackid
until #findcnt >= 3
if #findcnt >= 3
return
sub checksmithtools
repeat
#findcnt %smithtool C_ , #backpackid
if #findcnt < 3
{
gosub craftsmithtools
}
finditem %smithtool C_ , #backpackid
until #findcnt >= 3
if #findcnt >= 3
return
sub craftshields
finditem %smithtool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
{
wait 20
click 318 429
wait 20
}
return
sub donate
click 302 235 d
wait 10
click 290 318
wait 10
target 20
finditem FIK C_ , #backpackid
set #LtargetID #findid
event macro 22
wait 10
return
sub crafttinkertools
finditem %tinkertool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
wait 10
click 266 115
wait 10
return
sub craftsmithtools
finditem %tinkertool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
wait 30
click 410 252
wait 30
click 262 94
wait 30
return
set %ALERTS 3
set %ALERT1 Wiggles
set %ALERT2 Razor
set %ALERT3 Deathstar
set %stamPer ( #MAXSTAM * %stamPercMod ) / 100
set !jindex #jindex + 1
set %playerspotted #false
sub playercheck
set !nextjinedxend #jindex
if !jindex <= !nextjinedxend
{
for !ji !jindex !nextjinedxend
{
scanjournal !ji
for %number 1 %alerts
if %alert . %number in #journal
{
set %playerspotted #true
break
}
}
set !jindex !nextjinedxend + 1
}
if %playerspotted
{
while #true
{
sound alarm
}
}
sleep 10
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub loot
finditem YFM G_2
if #findkind <> -1
{
set %mobs_killed %mobs_killed + 1
set %corpse #findid
if %skin = #true && %training_mode = #false
{
if %use_war_cleaver = #true
set %skin_tool %cleaverid
set #lobjectid %skin_tool
event macro 17 0
target
set #ltargetid %corpse
event macro 22 0
wait 17
}
if %loot_gold = #false && %loot = N/A
{
ignoreitem %corpse
return
}
set #lobjectid %corpse
event macro 17 0
wait 5
gosub wait_gump container_gump 144_212 3
if #result = #false
return
wait 5
set %loot_container #contid
wait 13
ignoreitem %corpse
}
if #findkind = -1
return
gosub grab_items
hideitem %corpse
return