View unanswered posts | View active topics It is currently Sun Apr 19, 2026 11:51 am



Reply to topic  [ 3 posts ] 
 Haggle.ts 
Author Message
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post Haggle.ts
The haggle.ts provided in the zip file has some bugs.

Below is my beta fix for them. Ive run it for 12 hours without issue in worldtrade only.
I have not tried it with SSM so consider it a beta.

Code:
# Haggle.cts (haggle.ts) substitute to make TWX's Pack 2 routines compatable w/ EP's haggle.
# Replace the haggle.cts or haggle.ts file in the Include folder with this one.
:haggle
setTextLineTrigger buy :buy "We are selling up to "
setTextLineTrigger sell :sell "We are buying up to "
#new trigger
settextlinetrigger mess :mess "You don't have anything they want"
#sends the worldtrade back to the other port instead of stalling.
pause

:mess
killalltriggers
return

:buy
killtrigger mess
killTrigger getCredits
killTrigger done
setTextTrigger onhand :buyOnHand "]?"
pause
   :buyOnHand
   getWord CURRENTLINE $product 5
   if ($product <> $BuyProd)
      send "0*"
      setTextTrigger getCredits :getCredits "empty cargo holds."
      pause
   end
   send "*"
   # External haggle occurs here
#new trigger
   settexttrigger oops :oops "We're not interested."
#send the haggle to try again. This happens Very Rarely but will stall the worldtrade at times.
   setTextTrigger getCredits :getCredits "empty cargo holds."
   pause

:sell
killtrigger mess
killTrigger getCredits
killTrigger done
send "*"
# External haggle occurs here
settexttrigger oops :oops "We're not interested."
setTextTrigger getCredits :getCredits "empty cargo holds."
pause

:getCredits
killTrigger buy
killTrigger sell
killtrigger oops
getWord CURRENTLINE $Credits 3
stripText $Credits ","
setTextLineTrigger buy :buy "We are selling up to "
setTextLineTrigger sell :sell "We are buying up to "
setTextTrigger done :done "Command [TL="
pause

:oops
killalltriggers
send "p t"
goto :haggle

:done
killTrigger buy
killTrigger sell
killtrigger oops
return

_________________
Coconut Telegraph (ICQ)#586137616
Team Speak3@ 220.244.125.70:9987
Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
Image
Jesus wounldn't Subspace Crawl


Thu Jan 14, 2010 7:33 pm
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: Haggle.ts
Wow, I haven't actually looked at haggle.ts (not the haggle script, but the patch for pack 2 routines) in a long time. It has always done exactly what I wrote it to do, so what are the bugs? What I should do is rewrite it to provide the submenus that the original haggle.cts did, now that it is open source. Geez, now I'm gonna have to have a look.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Sat Jan 16, 2010 1:40 am
Profile WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post Re: Haggle.ts
"Not interested" when haggle bids to high causes worldtrade to stall.

Once in a while the worldtrade script doesn't buy because it is already full
(I think this is a bug in WT not haggle)

I added a trigger to kick it back to main script and it seems to solve the problem.

I have run WT non stop for 500,000,000 million worth of credits.

The only time it stops now is for a MBBS error where I get an echo and it waits for an input.

_________________
Coconut Telegraph (ICQ)#586137616
Team Speak3@ 220.244.125.70:9987
Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
Image
Jesus wounldn't Subspace Crawl


Sat Jan 16, 2010 5:39 pm
Profile ICQ YIM
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.