Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Update for 10.39
04-28-2014, 08:52 PM, (This post was last modified: 05-10-2014, 12:27 AM by lopht.)
#1
Script Update for 10.39
As always get it on the downloads page and post any bugs you find here.
changelog:
1.Cavebot no longer fails to attack some monsters
2.Looter should loot all corpses, unless you put a ;9 on the monsters at targetting.txt
3.The autoexplorer should work properly in the new areas now
4.There is a new script option for people to use. Its not super advanced, but hopefully it helps with some of the little things people have been requesting. It comes with a few small scripts to show how it works.
5.These changes only apply to 10.38/10.39

Directions are as follows, (this info is also in sample.lua)
Code:
To run scripts,
1.check the script[x] box
2.On your screen you should see @ All Scripts, F9 Hide/Show, F10 Reload
  a.If you dont see this, expand your tibia window or delete the scripts.cfg file
3.Drag the @ to move this where you want
4.Click on the individual scripts to turn them on/off
5.Click save to save your 'On' list

Note: Pressing Escape pauses all scripts, the same as it pauses hotkeys
      You can resume them by clicking "Click to Unpause" on your screen or pressing F11

Note2: All keys and options are customizeable by editing script_gui.lua and script_loader.lua

--------Draw Functions---------

printtext(text)  //prints to dos console box
DrawText(text,x,y,color)

----------Action Functions---------//try to call only 1 per callback
AttackTarget(targetid)
FollowTarget(targetid)
CastHotkey(text)
CastRuneTarget(runeid,targetid)
CastRuneXY(x,y,runeid)
MoveTo(x,y)
UseSpell(text)                          //talking, casting spells ect
UseContainerItem(cont_number,item_slot,id)   //eating food,opening bp ect
UseInventoryItem(inv_slot,id)                //eating food,opening bp ect
UseGroundItem(x,y,id)                        //using ladders switches corpses ect.
UseItemOnGround(x,y,id)                      //using rope/shovel/rune ect from your bps to the ground

ThrowItemCtoC(cont_number,item_slot,cont_number2,item_slot2,id,amount)
ThrowItemCtoI(cont_number,item_slot,inv_slot,id,amount)
ThrowItemItoC(inv_slot,cont_number2,item_slot2,id,amount)
ThrowItemCtoG(cont_number,item_slot,x,y,id,amount)
ThrowItemGtoC(x,y,cont_number,item_slot,id,amount)
ThrowItemGtoG(x,y,x2,y2,id,amount)

NpcSay(text)
NpcBuy(id,amount)
NpcSell(id,amount)

---------Container/Ground Functions---------
FindItem(id) returns cinfo or nil        //1st one found //   cinfo.num,cinfo.slot,cinfo.quantity
FindNextItem(id) returns cinfo or nil    //next one
GetGround(x,y) returns table             //t[1]=id1 t[2]=quantity1 t[3]=id2 t[4]=quantity2 t[5]=id3 ect   Ex GetGround(self.x+1,self.y)

---------Waypoint Functions----------
SetWaypoint(x,y,z)          // Note:to use ropes or ladders, make sure to put a waypoint on the rope hole and the next waypoint above next to the hole
SetHardWaypoint(x,y,z)      // Tries to go to the exact location
SetWarpWaypoint(x,y,z)      // Use this for stairs/holes and warps
SetStopPoint()
ClearWaypoints()
StartWaypoints()
StopWaypoints()
SetHuntingOn(0 or 1)        // SetHuntingOn(1) player hunts while doing waypoints

StartAutoExplorer(floors)   // Ex StartAutoExplorer(-2)=down 2 floors, StartAutoExplorer(0)=just the current floor
StopAutoExplorer()

--------More Global Functions----------
setTimerCallback(function)         //you need this if you want your script to persist
GetScriptPause() returns 1 or 0    //1 if scripts were paused
GetGround(x,y) returns idlist      //Ex GetGround(self.x+1,self.y)
IsKeyDown(number) returns number //accepts virtual key codes returns 0 if not pressed
SetManaPotIDS(normalmana,strongmana,greatmana,paladinmana)      // for use by the healer if your otserver has custom ids 0 means dont change
SetHealPotIDS(normalheal,strongheal,greatheal,paladinheal)      // Same as SetManaPotIDS
SetRuneIDS(ITEM_UH,ITEM_SD,ITEM_GFB,ITEM_MWALL,ITEM_ROPE)                 // Ex SetRuneIDS(3160,0,0,0,0) this changes the UH rune to 3160
SetLootTimer(time_in_ms)                                                  // Ex SetLootTimer(240)

-------Extras------
PlaySound("filename.wav") or PlaySound("Beep")
SetClipboard(text)


-----------self------------
self.name
self.x
self.y
self.z
self.id
self.sx
self.sy
self.hp
self.mp
self.hpmax
self.mpmax
self.condition
self.level
self.cap
self.exp
self.magiclevel
self.backpack
self.ring
self.ammy
self.arrow
self.arrowct
self.hand
self.handct
self.handleft
self.handleftct

----------creatures[MAXCREATURES]---------

creatures[i]
creatures[i].id
creatures[i].x
creatures[i].y
creatures[i].z
creatures[i].hp
creatures[i].movespeed
creatures[i].name
}

---------conts[MAXCONTAINERS]---------

conts[i].contnum
conts[i].name
conts[i].numitems
conts[i].items[j].id
conts[i].items[j].num

-------inventory------
SLOT_HEAD=1;
SLOT_AMMY=2;
SLOT_BACKPACK=3;
SLOT_ARMOR=4;
SLOT_HAND=5;
SLOT_HANDLEFT=6;
SLOT_LEGS=7;
SLOT_FEET=8;
SLOT_RING=9;
SLOT_AMMO=10;

EDIT: the newest one has a few more bug fixes with ramps and ladders
also, the cavebot uses a safe EXORIMAX now when hunting to avoid getting skull when a player is next to you and the target dies

EDIT2: make sure you download the newest one as there was another bugfix
Reply


Messages In This Thread
Script Update for 10.39 - by lopht - 04-28-2014, 08:52 PM
RE: Script Update for 10.39 - by Borikson - 04-29-2014, 12:05 AM
RE: Script Update for 10.39 - by lopht - 04-29-2014, 01:08 AM
RE: Script Update for 10.39 - by Denner - 04-30-2014, 07:59 AM
RE: Script Update for 10.39 - by Nandu - 04-29-2014, 06:54 AM
RE: Script Update for 10.39 - by younes - 04-29-2014, 07:28 AM
RE: Script Update for 10.39 - by lopht - 04-29-2014, 10:16 AM
RE: Script Update for 10.39 - by Macelbb - 04-30-2014, 07:16 AM
RE: Script Update for 10.39 - by Nandu - 04-29-2014, 12:36 PM
RE: Script Update for 10.39 - by Borikson - 04-30-2014, 01:53 AM
RE: Script Update for 10.39 - by djtuca - 04-30-2014, 09:05 AM
RE: Script Update for 10.39 - by lopht - 04-30-2014, 01:25 PM
RE: Script Update for 10.39 - by djtuca - 05-01-2014, 04:12 AM
RE: Script Update for 10.39 - by nsales7788 - 04-30-2014, 12:43 PM
RE: Script Update for 10.39 - by lopht - 04-30-2014, 01:36 PM
RE: Script Update for 10.39 - by nsales7788 - 05-01-2014, 08:54 AM
RE: Script Update for 10.39 - by Denner - 04-30-2014, 09:19 PM
RE: Script Update for 10.39 - by lopht - 05-01-2014, 12:59 AM
RE: Script Update for 10.39 - by Denner - 05-01-2014, 04:35 AM
RE: Script Update for 10.39 - by lopht - 05-01-2014, 02:29 PM
RE: Script Update for 10.39 - by Denner - 05-02-2014, 07:43 AM
RE: Script Update for 10.39 - by lopht - 05-03-2014, 03:35 AM
RE: Script Update for 10.39 - by Borikson - 05-04-2014, 02:20 AM
RE: Script Update for 10.39 - by lopht - 05-08-2014, 02:06 PM
RE: Script Update for 10.39 - by Denner - 05-07-2014, 08:45 PM
RE: Script Update for 10.39 - by Borikson - 05-11-2014, 08:48 AM
RE: Script Update for 10.39 - by djtuca - 05-12-2014, 12:59 AM
RE: Script Update for 10.39 - by Borikson - 05-12-2014, 02:51 AM
RE: Script Update for 10.39 - by djtuca - 05-12-2014, 03:40 AM
RE: Script Update for 10.39 - by Old Ten - 06-09-2014, 12:15 PM
RE: Script Update for 10.39 - by Kitzz - 07-08-2014, 10:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)