www.ClassicTW.com
https://mail.black-squirrel.com/

Worldtrade for Perfect_haggle
https://mail.black-squirrel.com/viewtopic.php?f=15&t=25429
Page 1 of 1

Author:  Parrothead [ Wed Jan 13, 2010 5:49 pm ]
Post subject:  Worldtrade for Perfect_haggle

These 2 scripts work with mom bot

or fire off a ck script to set the $_CK_PTRADESETTING variable in the cfg file.

also needs a $mbbs var set to 1 for mbbs mode or 0 for classic/gold.


Will load Ep_haggle without menu and load for best price or blue price.

If you want to customize your own ill post some simple code to let you do it for yourself.

Author:  Parrothead [ Wed Jan 13, 2010 6:07 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Ill try attachment again

Attachments:
Pack2WorldTrades for Perfect Haggle.zip [38.1 KiB]
Downloaded 428 times

Author:  NjoY [ Wed Jan 13, 2010 6:43 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Pls post the code.
Also can i change the variables in the .cfg file from within a script??
It will have to be before i run perfect_haggle tho wont it?

Author:  Vid Kid [ Wed Jan 13, 2010 6:59 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Njoy ; the whole purpose of .cfg is for a place to drop those
LOADVAR
and
SAVEVAR variables to play with within other scripts.

So write a script to setVar and then savevar and you've changed one.

check by loading it to look... echo to show yourself.

Author:  Parrothead [ Wed Jan 13, 2010 7:01 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Code:
reqRecording
logging off

gosub :9_dupescripts~scriptcheck

setVar $Header~Script "World Trade"
loadvar $_CK_PTRADESETTING
if ($_CK_PTRADESETTING = 0)
loadvar $PTRADESETTING
setvar $_CK_PTRADESETTING $PTRADESETTING
end
setvar $PercTrade $_CK_PTRADESETTING
setvar $PPT~PercTrade $_CK_PTRADESETTING

listActiveScripts $scripts
setvar $a 1
while ($a <= $scripts)
lowercase $scripts[$a]
if ($scripts[$a] = "ep_haggle2010.cts")
stop ep_haggle2010
end
add $a 1
end

:set_haggle
setvar $file GAMENAME & "_HaggleOpt.txt"
delete $file
loadvar $mbbs
if ($mbbs = TRUE)
setvar $mbbs_ep "On"
else
setvar $mbbs_ep "Off"
end
write $file "Off"
write $file "Off"
write $file $mbbs_ep
write $file $_CK_PTRADESETTING
write $file "On"
write $file "Off"
write $file "Active"
write $file "On"

killalltriggers
seteventtrigger hag0 :hag0 "SCRIPT LOADED"
setdelaytrigger wait0 :wait 30000
load ep_haggle2010
send "*"
waiton "Command [TL="
pause
:hag0
killalltriggers
# check location
waiton #179
send "*"
waiton "ommand"
waiton #179
send "*"
waiton "ommand"
cutText CURRENTLINE $location 1 12
if ($location <> "Command [TL=")
        clientMessage "This script must be run from the command menu"
        halt
end



# get defaults    <<<<<<<<< Look for this line in 2_worldtrade.ts



Replace the Pack2 /include/Haggle.ts with Haggle.ts that comes with Perfect Haggle Zip file haggle



At this point you can change include files. I set up seperate directory for this as to keep a clean copy of Pack 2 includes.


For example in the above files the drop fig under ports has been changed from a toll fig to a defensive one. and the default for xtra macro set to f1*cd/ as a default.

You can preset the menu variables and have it completely botable with no menu if you want.

Let me know if you need anything else to get it running.


Remember EP Perfect haggle needs the MBBS and Ptrade numbers to work.

Author:  Daala [ Wed Jan 13, 2010 7:04 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

<removed>

Author:  Parrothead [ Wed Jan 13, 2010 7:07 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

$MBBS=0 <<<<<<this one

$INTERNALALIENS=1
$INTERNALFERRENGI=1
$MAX_COMMANDS=255
$INACTIVE_TIME=300
$COLONIST_REGEN=65535
$MAX_PLANETS_PER_SECTOR=3
$PHOTON_DURATION=1
$PHOTONS_ENABLED=1
$DEBRIS_LOSS=100

$PTRADESETTING=100 <<<<<<<this one

from a mombot starup in config file.




The include mentioned on first line is a Duplicate script preventer.


Code:
#:9_dupescripts~scriptcheck
:scriptcheck
#set array
listActiveScripts $scripts
listActiveScripts $scriptsx
#end load background scripts check for duplicates
:duplicates
setvar $a 1
:duplicates0
while ($a <= $scripts)
setvar $b 1
lowercase $scripts[$a]
while ($b <= $scripts)
lowercase $scriptsx[$b]
if (($a <> $b) and ($scripts[$a] = $scriptsx[$b]))
stop $scripts[$a]
goto :scriptcheck
end
add $b 1
end
add $a 1
end
return




add if anyone asks I wrote this not Oz

Author:  NjoY [ Thu Jan 14, 2010 4:18 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Vid Kid wrote:
Njoy ; the whole purpose of .cfg is for a place to drop those
LOADVAR
and
SAVEVAR variables to play with within other scripts.

So write a script to setVar and then savevar and you've changed one.

check by loading it to look... echo to show yourself.


Hi Vid. Thanx.
I know i can do that with Mombot variables. I was trying to do that with the HaggleOpt.txt cfg file. Change the variables without having to delete and write a new HaggleOpt.txt cfg file like PH did in his very helpful example. Thanx for that PH.
It prolly will work by deleting it, gonna try that later tonight.
Thanx again.

Author:  Parrothead [ Thu Jan 14, 2010 6:41 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

EP doesnt store the variables in the cfg file.
Mombot does.
Which it is why you must rewrite the TXT file then start or restart the Haggle to change settings.
As far as I know the text file is only poled off the menu close or on start. So you cannot change from blue to best to worst without closing the Haggle and restarting it.

Perhaps EP will include a texttrigger in the haggle so we can force a read of the file in the next version.

Author:  NjoY [ Thu Jan 14, 2010 7:16 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Parrothead wrote:
EP doesnt store the variables in the cfg file.
Mombot does.
Which it is why you must rewrite the TXT file then start or restart the Haggle to change settings.
As far as I know the text file is only poled off the menu close or on start. So you cannot change from blue to best to worst without closing the Haggle and restarting it.

Perhaps EP will include a texttrigger in the haggle so we can force a read of the file in the next version.


Parrothead wrote:
------ Get your copy of Dny_Spoof-O-matic.cts from Grimytrader.com ------

Thats y grimy's went down, every1 searching for that lol

Parrothead wrote:
EP doesnt store the variables in the cfg file.
Mombot does.

If you DIDNT get that the wrong way round... you lost me there. sry.
EP Haggle DOES store the variables i wanna access from Mombot

Author:  Parrothead [ Thu Jan 14, 2010 7:27 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

No Haggle stores the setting in the text file called GAMENAME_HaggleOpt.txt

It's in the code in the first post.

Author:  Helix [ Fri Feb 12, 2010 3:45 pm ]
Post subject:  Re: Worldtrade for Perfect_haggle

Parrothead wrote:
Ill try attachment again


Just a heads up, both of these hang on the avoid mine prompt. Any chance of a recompile using the PPT.ts I posted here?

I like them both BTW

Helix

Author:  Parrothead [ Sat Feb 13, 2010 12:58 am ]
Post subject:  Re: Worldtrade for Perfect_haggle

Helix wrote:
Parrothead wrote:
Ill try attachment again


Just a heads up, both of these hang on the avoid mine prompt. Any chance of a recompile using the PPT.ts I posted here?

I like them both BTW

Helix


Yes I can repost.
Water pump broke so may be a day or 2

Author:  Helix [ Sat Feb 13, 2010 1:54 am ]
Post subject:  Re: Worldtrade for Perfect_haggle

kk,

Thanks

Helix

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