www.ClassicTW.com
http://classictw.com/

Haggle In world trade twx 2.05
http://classictw.com/viewtopic.php?f=15&t=34559
Page 1 of 1

Author:  Comet [ Wed Mar 18, 2015 11:18 am ]
Post subject:  Haggle In world trade twx 2.05

Getting this line frequently.

them for 1,152 credits.
Your offer [Script run-time error in 'HAGGLE': '' is not a number, line 223

Script terminated: scripts\2_worldtrade.ts



Anyone know what could be causing it? I've never been fine tuned for scripts.

TWGS V 2.20B

Quest TWGS is what it's on.

Author:  methods [ Wed Mar 18, 2015 11:58 am ]
Post subject:  Re: Haggle In world trade twx 2.05

I don't know what's causing your bug, but I would use the uncompiled version of world trade and insert some debug statements before line 223 is executed.

this is from the v. 2.03 source release, so idk if anything's been modified, but it looks like it's getting some unexpected (non-numerical) value as $firstOffer

e.g.
getWord CURRENTLINE $firstOffer 3

since it's just hardcoded based on an index position, could something have changed in the new TWGS release?

anyhow, I would try to print out the contents of $firstOffer prior to the point of failure. Also wouldn't hurt to take a look at whatever is being parsed as CURRENTLINE, in case the error is further up the chain.

if ($firstOffer = 0)
getWord CURRENTLINE $firstOffer 3

echo CURRENTLINE
echo $firstOffer

stripText $firstOffer "["
stripText $firstOffer "]"
stripText $firstOffer ","
end

... but really I'm just guessing... I haven't played TW in a decade and I don't even have twx 2.05 installed (is this a thing? where is it hosted?)

Author:  Vid Kid [ Fri Mar 20, 2015 5:18 am ]
Post subject:  Re: Haggle In world trade twx 2.05

Comet wrote:
Getting this line frequently.

them for 1,152 credits.
Your offer [Script run-time error in 'HAGGLE': '' is not a number, line 223

Script terminated: scripts\2_worldtrade.ts



Anyone know what could be causing it? I've never been fine tuned for scripts.

TWGS V 2.20B

Quest TWGS is what it's on.


That looks like the getword or cuttext command did not get the number
or the settexttrigger was not set to grab after the target number.
One other thing it could be , is when it grabs a number it did not have a striptext (variable) ","
so that 1,250 would be a number 1250

Without seeing the actual code I can only offer ideas based on the error shown.

Hope this helps.
If you have the .ts script of the file your running , I'll fix it for you.
But my guess is that its the haggle routeen in your includes that has the erroneous code.

I may have fixed this a few years back.
If you want to try my .cts to see if you have same issue ?

Attachment:
File comment: This is the .cts I use.
2_WorldTrade.cts [73.33 KiB]
Downloaded 714 times


Vid Kid/CareTaker

Author:  Comet [ Fri Mar 20, 2015 8:23 am ]
Post subject:  Re: Haggle In world trade twx 2.05

Thanks Vid i'll run this for a few days and see what happens. Appreciate the assistance. I thought it was my Haggle Script. I've sent you the haggle script via email that I have. It's nothing special. I just pulled it from grimy trader when I downloaded 2.05 TWX.

Thanks!

Author:  Vid Kid [ Fri Mar 20, 2015 3:41 pm ]
Post subject:  Re: Haggle In world trade twx 2.05

I fixed your haggle script and resent it back to you.

I hope it works the way you intended it to.
The only problem I found was when it was written
scripts ran slower on TWGS v1 , but on v2 you have to mod scripts
to set trigger grab after the target data or you end up grabbing nothing.

in this case the line it was in :
"Your offer [XXX] ?"
originally triggered on:
"Your offer ["
now triggers on:
"] ?"

This is just one example of script changes between TWGS v1 and v2
scripts .. and then they will work on both versions.

Hope this helps.

Vid

Author:  Krimsonblade [ Mon May 25, 2015 2:24 am ]
Post subject:  Re: Haggle In world trade twx 2.05

I've ran into the same issue I'll have to give this a try

Author:  Assaulter [ Mon May 25, 2015 4:17 am ]
Post subject:  Re: Haggle In world trade twx 2.05

You are getting the exact same error that comet was getting, down to the line and everything? Are you playing on a V2 or V1 server? Post the source of the script (if available) that is giving you trouble and the error message as it appears in TW.

Author:  wyvern1 [ Tue May 26, 2015 10:32 pm ]
Post subject:  Re: Haggle In world trade twx 2.05

Can`t help you much; as I suck at script writing. But I love guys that use world trade. Thx for the credits---your in a pod. LOL

Author:  Comet [ Sun May 31, 2015 7:02 am ]
Post subject:  Re: Haggle In world trade twx 2.05

Haven't had any issues since I've started using Vid's Script. I undid what I did to cause this error in the first place and Vid's script hands down gets you more money than the reg TWX world trade. Hope that helps! Thanks again Vid appreciate it!


Comet

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/