Author Topic: First script and could use some help  (Read 5966 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3022
  • Activity:
    3.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: First script and could use some help
« Reply #15 on: May 09, 2012, 01:18:27 PM »
0
Found out a couple of things, it is cutting bones but not at the end of the script after it pulls the chest but while it is fishing. It also cuts up all bone piles but one. In some ways it is cool that it is cutting them up while fishing but it means that I wrote something wrong because it is doing the sub before I want it to. I want it to fish up the chest. Once it recognizes that the chest is fished up, I want it to cut up any and all bone piles in my bag. I put in a scan for bones in the backpack and it was working and that is how I verified that it was doing it during the fishing. Part of my scan was a display that would say we have bones if there were bones in the back pack. my scan-sub is this:

Code: [Select]
sub scan_bones
scan #backpackid
Finditem %cuttypes C_ , #backpackid
if #findcnt >= -1
{
display We Have Bones!
gosub cut_bones
}
return
;---------

I am not sure if that is correct or not but it seems to be working. Also can someone explain this to me?

Code: [Select]
if #findcnt >= -1
I am not sure what the -1 means

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: First script and could use some help
« Reply #16 on: July 17, 2012, 11:27:08 AM »
0
Code: [Select]
if #findcnt >= -1
I am not sure what the -1 means

Means .. if the number of items found is greater than -1, obviously cannot have -1 items so the that will always trigger even if you found 0 items as 0 is > -1.

So the correct statment should have been  1.. as below

Code: [Select]
sub scan_bones
  Finditem %cuttypes C_ , #backpackid
  if #findcnt >= 1
    {
    display We Have Bones!
    gosub cut_bones
    }
return
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."

Tags: