SRL Archive - MSI Suggestions

Automatically Updating Records


Coh3n

2010-11-29 02:01:46

RM, I know you'll like this as I've seen you mention it multiple times in reflection-color hybrid discussions. ;) It's a pretty basic idea that will make our lives much easier.

Rather than having all our records saved in .simba files, I think they should be saved in INI files. Format could be something like

[10]
Name=Bronze pickaxe // This would be the EXACT uptext
Uptext0=onze pi // If there's another way to do arrays, I'd love to know
Uptext1=ze pick
Colors0=5344186
Tol=5
Stackable=False
DTM= // Not exactly sure how this can be done?
DTMs being the only issue. The INI format itself would look really messy, but it can be easily read from. I suppose we can write some functions that read a more organized format, but I don't think that's necessary.

This way we can update items/objects/whatever else during runtime, so we don't have to and the script will correct itself. ;) It would also clean the include quite a bit.

Oh, this would be added when reflection is added so we know exactly when to update the records.

Thoughts?

E: Here's an idea of what the file would look like

[10]
Name=Bronze pickaxe
Uptext0=onze pi
Colors0=5344186
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHso9OjQBjBgYmFMwPJPkZsANGLBgCANO2F5U=

[11]
Name=Iron pickaxe
Uptext0=ron pi
Colors0=12040384
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHsg/s2A7GDAxMKJgfSPIzYAeMWDAEAAAcOxiP

[12]
Name=Steel pickaxe
Uptext0=eel pi
Colors0=12435142
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHsq+dPQvGDAxMKJgfSPIzYAeMWDAEAABCURkR

[13]
Name=Mithril pickaxe
Uptext0=ril pi
Colors0=11958905
Tol=4
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHsmvrdoIxAwMTCuYHkvwM2AEjFgwBANOQF5k=

[14]
Name=Adamant pickaxe
Uptext0=ant pi
Colors0=9743251
Tol=6
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHsmdvng3GDAxMKJgfSPIzYAeMWDAEAADzFhgD

[15]
Name=Rune pickaxe
Uptext0=une pi
Colors0=12495486
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAG4g/g8EH4H4DxDDxFmA+O9/CBAHsutW7QNjBgYmFMwPJPkZsANGLBgCAPDUF/0=

[16]
Name=Dragon pickaxe
Uptext0=agon pi
Colors0=725070
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////AMQ/gZgdSZwFiAWg8l+B2E+AmwGEGRiYUDA/kORnwA4YsWAIAAAXvhTm

[20]
Name=Bronze Hatchet
Uptext0=onze hat
Colors0=1649466
Colors1=1583415
Colors2=1715516
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4FyVtqSDCDMwMCEgvmBJD8DdsCIBUMAAAjbDSo=

[21]
Name=Iron Hatchet
Uptext0=on hatch
Colors0=3618618
Colors1=3815996
Tol=4
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4FyVubmDCDMwMCEgvmBJD8DdsCIBUMAACE7DX4=

[22]
Name=Steel Hatchet
Uptext0=eel hatc
Colors0=5855581
Colors1=6118753
Colors2=6513511
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4FysZGRDCDMwMCEgvmBJD8DdsCIBUMAAF2XDkw=

[23]
Name=Mithril Hatchet
Uptext0=thril ha
Colors0=4599598
Colors1=4468013
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4FyevpuDCDMwMCEgvmBJD8DdsCIBUMAAB4XDXQ=

[24]
Name=Adamant Hatchet
Uptext0=amant ha
Colors0=3291698
Colors1=3423284
Tol=4
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4FyRlZGDCDMwMCEgvmBJD8DdsCIBUMAABtZDWo=

[25]
Name=Rune Hatchet
Uptext0=ne hatch
Colors0=4932921
Colors1=5261885
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg/vL///+vQMyIJM4GxEJAzArEf4Fylq7eDCDMwMCEgvmBJD8DdsCIBUMAADRnDcA=

[26]
Name=Dragon Hatchet
Uptext0=gon hat
Colors0=856663
Colors1=790865
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAC4g/vb////3QMyFJA7k/mcE0iJAzAbEoYI8YMzAwISC+YEkPwN2wIgFQwAAN48NIA==

[30]
Name=Normal logs
Uptext0=Logs
Colors0=2704989
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QHasmyYDCDMwMKFgfiDJz4AdMGLBEAAAg0QRsw==

[31]
Name=Oak logs
Uptext0=logs
Colors0=3496567
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QHZtnDkDCDMwMKFgfiDJz4AdMGLBEAAArGwSPw==

[32]
Name=Willow logs
Uptext0=illow
Uptext1=illow logs
Uptext2=low
Colors0=2509137
Tol=6
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QLaTlQgDCDMwMKFgfiDJz4AdMGLBEAAAYBAROw==

[33]
Name=Maple logs
Uptext0=ple logs
Colors0=800853
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QHaoBQ8DCDMwMKFgfiDJz4AdMGLBEAAAZYwRTQ==

[34]
Name=Yew logs
Uptext0=ew l
Colors0=668228
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QLaLERcDCDMwMKFgfiDJz4AdMGLBEAAAVsgRGw==

[35]
Name=Magic logs
Uptext0=gic lo
Colors0=9609010
Tol=2
Stackable=False
DTM=mggAAAHicY2NAAEYg5gHi7/////8ExDDxL0A2K5DmAOJ/QHZKjCUDCDMwMKFgfiDJz4AdMGLBEAAAnZASDQ==

[40]
Name=Clay
Uptext0=lay
Uptext1=Clay
Colors0=5274001
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgL/////nBtKsQMyMJP4LKP7jPwR8AeLJ1YEMIMzAwISC+YEkPwN2wIgFQwAADOgW1g==

[41]
Name=Copper ore
Uptext0=opper
Colors0=3762874
Tol=3
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9A9voUUwYQZmBgQsH8QJKfATtgxIIhAAAMKxKr

[42]
Name=Tin ore
Uptext0=in or
Colors0=6842476
Tol=2
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AdlJsLAMIMzAwoWB+IMnPgB0wYsEQAADxahJT

[43]
Name=Iron ore
Uptext0=ron o
Colors0=1515574
Tol=2
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AtrWyFAMIMzAwoWB+IMnPgB0wYsEQAACRihEL

[44]
Name=Silver ore
Uptext0=ilver
Colors0=9538186
Tol=10
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AdlfXRAYQZmBgQsH8QJKfATtgxIIhAABBpxNl

[45]
Name=Coal ore
Uptext0=oal
Colors0=1844261
Tol=3
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AtqqKDAMIMzAwoWB+IMnPgB0wYsEQAACGOBDl

[46]
Name=Gold ore
Uptext0=Gold
Uptext1=old
Colors0=1675188
Tol=13
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9A9pZ+SQYQZmBgQsH8QJKfATtgxIIhAAAYJRLT

[47]
Name=Mithril ore
Uptext0=ithril
Colors0=5519672
Tol=3
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AtoVlCAMIMzAwoWB+IMnPgB0wYsEQAAC+LhGl

[48]
Name=Adamantite ore
Uptext0=daman
Colors0=6517347
Tol=3
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AtrWLNQMIMzAwoWB+IMnPgB0wYsEQAAC39BGP

[49]
Name=Runite ore
Uptext0=unite
Colors0=5525056
Tol=8
Stackable=False
DTM=mggAAAHicY2NAgN////9/D8ScQDYvkvgHoBgbkGYF4l9AtoNfCAMIMzAwoWB+IMnPgB0wYsEQAADPPBHf

[60]
Name=Small Fishing Net
Uptext0=ishing net
Colors0=2569539
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////BMS8QDYnkvgXoBgjkP4NpLmBtLOpOhgzMDChYH4gyc+AHTBiwRAAALv2EWM=

[61]
Name=Crayfish Cage
Uptext0=rayfish cage
Colors0=5461079
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD////9nAtLcQPwNyIaJfwKy2YH0dyDNAqTDQ4LBmIGBCQXzA0l+BuyAEQuGAADPuBIV

[62]
Name=Fishing Rod
Uptext0=ishing rod
Colors0=5197651
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAE4g5gJiNiAWRxP/8v//fyYg/Q5IB/v7M4AwAwMTCuYHkvwM2AEjFgwBAEoVCis=

[63]
Name=Fishing Bait
Uptext0=ishing bait
Colors0=1605551
Tol=5
Stackable=True
DTM=mggAAAHicY2NAgA////9nAtJcQPwZyIaJ/wGyfwHxXyBmBfLX10uAMQMDEwrmB5L8DNgBIxYMAQBWYBaW

[64]
Name=Fly Fishing Rod
Uptext0=ly fishing
Colors0=3355445
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAEEgZgLin////2dBEv8A5PMAaQ4g/gFkmxobM4AwRDUC8wNJfgbsgBELhgAAz5INaw==

[65]
Name=Harpoon
Uptext0=arpoon
Colors0=6052960
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgPf/////CcQsQPZXIA0TlwNiJiBmBmI+IE6IiQFjiCgC8wNJfgbsgBELhgAA5dsOaw==

[66]
Name=Lobster Pot
Uptext0=obster pot
Colors0=6184546
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAG4g/vD//39GIP0TSMPEPwLZTECaHYjfAtlJcXEMIMzAwISC+YEkPwN2wIgFQwAAukoSPg==

[70]
Name=Raw shrimps
Uptext0=aw shrimps
Colors0=1712955
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgG//////CcSMQDYHkvgvoBgbkOYGYhYgbo71AGMGBiYUzA8k+RmwA0YsGAIAvUcOgA==

[71]
Name=Raw crayfish
Uptext0=aw crayfish
Colors0=1914462
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////CcQ/gJgFSfw7kM8FpAWAGCSebi0PxgwMTCiYH0jyM2AHjFgwBAAAMRsRrg==

[72]
Name=Raw sardines
Uptext0=aw sardine
Colors0=6466656
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgJ//////C8QsQDYbkjgTlP8DKPcPiKevn84AwhAZBOYHkvwM2AEjFgwBAEZnE94=

[73]
Name=Raw herring
Uptext0=aw herring
Colors0=11053232
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAGYg/v7//38QLYgk/hMoxgakWYH4L5C9bP58BhBmYGBCwfxAkp8BO2DEgiEAAKCDEAA=

[74]
Name=Raw anchovies
Uptext0=aw anchovies
Colors0=7696496
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgG//////CcSMQDYHkvgvoBgbkOYGYhYgDg+PBmMGBiYUzA8k+RmwA0YsGAIAqp8OQg==

[75]
Name=Raw trout
Uptext0=aw trout
Colors0=11843005
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+H4nnTpzOAMAMDEwrmB5L8DNgBIxYMAQCeABe4

[76]
Name=Raw pike
Uptext0=aw pike
Colors0=10269852
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+H4jlb5jCAMAMDEwrmB5L8DNgBIxYMAQCwshf4

[77]
Name=Raw salmon
Uptext0=aw salmon
Colors0=9606569
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+H4kWpUQwgzMDAhIL5gSQ/A3bAiAVDAABf0Bbi

[78]
Name=Raw tuna
Uptext0=aw tuna
Colors0=9408662
Tol=5
Stackable=False
DTM=mggAAAHicY2NABaxAzAXEn////w8T+wJkfwNiEM0B5E+b0A/GDAxMKJgfSPIzYAeMWDAEAADH1hN4

[79]
Name=Raw lobster
Uptext0=aw lobster
Colors0=2046823
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////DcQ8QDYbkjgjEH8Hir8HYpB4rbsaGDMwMKFgfiDJz4AdMGLBEAAA1mAR8A==

[80]
Name=Raw swordfish
Uptext0=aw swordfish
Colors0=9264774
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgB////9/D8RsQDYLkvg/oJggkOYC4t9A9raGAwwgzMDAhIL5gSQ/A3bAiAVDAAB1sxQX

[100]
Name=Cooked shrimps
Uptext0=hrimps
Colors0=996713
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgG//////CcSMQDYHkvgvoBgbkOYGYhYgbrQXAmMGBiYUzA8k+RmwA0YsGAIAi0sN1A==

[101]
Name=Cooked crayfish
Uptext0=rayfish
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////CcQ/gJgFSfw7kM8FpAWAGCTeEyAMxgwMTCiYH0jyM2AHjFgwBAAATHESCg==

[102]
Name=Cooked sardines
Uptext0=ardine
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgJ//////C8QsQDYbkjgTlP8DKPcPiFFlEJgfSPIzYAeMWDAEAAAu2hAk

[103]
Name=Cooked herring
Uptext0=erring
Tol=5
Stackable=False
DTM=mggAAAHicY2NAAGYg/v7//38QLYgk/hMoxgakWYH4L5CNkGFCwfxAkp8BO2DEgiEAAITODDg=

[104]
Name=Cooked anchovies
Uptext0=nchovies
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgG//////CcSMQDYHkvgvoBgbkOYGYhYGZMCEgvmBJD8DdsCIBUMAAA9hDDA=

[105]
Name=Cooked trout
Uptext0=rout
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+H4vLMdAYQZmBgQsH8QJKfATtgxIIhAABQJBau

[106]
Name=Cooked pike
Uptext0=ike
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+HYoQMEwrmB5L8DNgBIxYMAQCQWxQg

[107]
Name=Cooked salmon
Uptext0=almon
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgF//////AcTsQLYAkjgHEP8Din+HYoQMEwrmB5L8DNgBIxYMAQCQWxQg

[108]
Name=Cooked tuna
Uptext0=una
Tol=5
Stackable=False
DTM=mggAAAHicY2NABaxAzAXEn////w8T+wJkfwNiEM0B5McGBYAxAwMTCuYHkvwM2AEjFgwBAF0+Egw=

[109]
Name=Cooked lobster
Uptext0=obster
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgD//////DcQ8QDYbkjgjEH8Hir8HYpD45QxZMGZgYELB/ECSnwE7YMSCIQAAF6ESzA==

[110]
Name=Cooked swordfish
Uptext0=wordfish
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgB////9/D8RsQDYLkvg/oJggkOYC4t9AdltcHwMIMzAwoWB+IMnPgB0wYsEQAAAoXxMP

[120]
Name=Uncut sapphire
Uptext0=ut sapp
Colors0=7475984
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAA4gZgfi7////wdhmDg3EP8C8n8AMUgNv1A+GDMwMKFgfpAcA3bAiAVDAABkbhFI

[121]
Name=Uncut emerald
Uptext0=ut emer
Colors0=1206543
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAA4gZgfi7////wdhmDg3EP8C8n8AMUgNbxw/GDMwMKFgkAg/A3bAiAVDAABYRhEc

[122]
Name=Uncut ruby
Uptext0=ut rub
Colors0=791129
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAA4gZgfi7////wdhmDg3EP8C8n8AMUhNlBAPGDMwMKFgfiDJz4AdMGLBEAAAV7oRGA==

[123]
Name=Uncut diamond
Uptext0=ut diamo
Colors0=9145233
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAA4gZgfi7////wdhmDg3EP8C8n8AMUjN5N5eMGZgYELB/ECSnwE7YMSCIQAADEcTgg==

[130]
Name=Bird's nest
Uptext0=s nest
Colors0=3489088
Tol=11
Stackable=False
DTM=mggAAAHicY2NAgP9A8AmImYBsPiTx70AxEM0JxMxAbGKoAcYMDEwomB9I8jNgB4xYMAQAAGHVDUc=

[131]
Name=Feather
Uptext0=eather
Colors0=530952
Tol=5
Stackable=False
DTM=mggAAAHicY2NAgA/////nA9J/gDQbkrgQEH8Fiv0GYhYgm0OKA4wZGJhQMD+Q5GfADhixYAgAAFo6EIA=

[150]
Name=Staff of Air
Uptext0=of air
Colors0=12235442
Colors1=13353922
Colors2=12564407
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYo/eb///8/gBgm/hfIZgHS4kDMBsSbNu0CYwYGJhTMDyT5GbADRiwYAgAKwBBo

[151]
Name=Staff of Water
Uptext0=of water
Colors0=11804186
Colors1=14427424
Colors2=13115933
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYo/eb///8/gBgm/hfIZgHS4kDMBsSySifAmIGBCQXzA0l+BuyAEQuGAABl8Q46

[152]
Name=Staff of Earth
Uptext0=of earth
Colors0=3227223
Colors1=4874115
Colors2=4808066
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYo/eb///8/gBgm/hfIZgHS4kDMBsQ1kW5gzMDAhIL5gSQ/A3bAiAVDAABzaw5i

[153]
Name=Staff of Fire
Uptext0=of fire
Colors0=1713844
Colors1=1977293
Colors2=2109145
Tol=3
Stackable=False
DTM=mggAAAHicY2NAAEYo/eb///8/gBgm/hfIZgHS4kDMBsQntGTBmIGBCQXzA0l+BuyAEQuGAABtTQ5K

[160]
Name=Air rune
Uptext0=Air
Uptext1=ir
Uptext2=ir r
Colors0=10296087
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgK//////CcRsQLYAkvg/oBg7kOYCYkYgvnv5MhgzMDChYH4gyc+AHTBiwRAAAI3MEUM=

[161]
Name=Body rune
Uptext0=ody r
Colors0=921102
Colors1=12656924
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgPf/////BMQgNheSOCsQ8wKxIBCzg9g8PGDMwMCEgvmBJD8DdsCIBUMAALePCIs=

[162]
Name=Mind rune
Uptext0=nd run
Colors0=2129366
Colors1=538424
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgPf/////BMQgNheSOCsQ8wKxIBCzA7GpKTsYMzAwoWB+IMnPgB0wYsEQAADkcQkj

[163]
Name=Earth rune
Uptext0=th ru
Colors0=867676
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgjrTiAWMGBiYUzA8k+RmwA0YsGAIAbU8Nbw==

[164]
Name=Fire rune
Uptext0=ire ru
Colors0=1515933
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgni0vCsYMDEwomB9I8jNgB4xYMAQAAInhDc8=

[165]
Name=Water rune
Uptext0=er ru
Colors0=10296087
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgFpWcDcYMDEwomB9I8jNgB4xYMAQAAIRFDcM=

[166]
Name=Chaos rune
Uptext0=haos
Colors0=2137558
Colors1=13948126
Colors2=538424
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgvjpLDowZGJhQMD+Q5GfADhixYAgAAPmXD0s=

[167]
Name=Law rune
Uptext0=aw ru
Colors0=14034208
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgPf/////BMQgNheSOCsQ8wKxIBCzA7Gc0lUwZmBgQsH8QJKfATtgxIIhAABCzgpr

[168]
Name=Cosmic rune
Uptext0=osmic
Colors0=2151638
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgvnpZDowZGJhQMD+Q5GfADhixYAgAABsMD70=

[169]
Name=Death rune
Uptext0=Death
Uptext1=eath rune
Uptext2=eat
Colors0=13948126
Colors1=921102
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgK//////CcRsQLYAkvg/oBg7kOYCYkYgvnv5MhgzMDChYH4gyc+AHTBiwRAAAI3MEUM=

[170]
Name=Nature rune
Uptext0=ture r
Colors0=1408531
Tol=3
Stackable=True
DTM=mggAAAHicY2NAgI//////CsSsQDYPkvg/oBgHkOYCYkYgFqwRAWMGBiYUzA8k+RmwA0YsGAIAbdsNcw==
Did it with:

var
i, j: Integer;
p: string;
d: TMDTM;
begin
ClearDebug;

AddOnTerminate('MSI_ScriptTerminate');
SetScriptProp(SP_WriteTimeStamp, [True]);

Smart_Server := WORLD_SMART;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ActivateClient;

SetupSRL;
SetupMSI;

{$IFDEF REFLECTION}
// So if the hooks are outdated, the script will attempt colour walking if the points exist
if (not MSI_SetupReflection(False)) then
ReflectionBroken := True;
{$ELSE}
ReflectionBroken := True; // Set to true because it's not even being used
{$ENDIF}

if (ReflectionBroken) then
ShowMessage('WARNING: Reflection hooks are outdated!');

Stats_UserID := STATS_ID;
Stats_Password := STATS_PASS;
Stats_ScriptID := '47';
CurrDebugLevel := 1;

DeclarePlayers;
//MSI_Mainloop;

p := IncludePath+'MSI\Items.txt';
for i := 0 to High(MSI_Items) do
with MSI_Items[i] do
if (Name <> '') then
begin

WriteINI(IntToStr(i), 'Name', Name, p);

for j := 0 to High(Uptext) do
WriteINI(IntToStr(i), 'Uptext'+IntToStr(j), Uptext[j], p);

for j := 0 to High(Colors) do
WriteINI(IntToStr(i), 'Colors'+IntToStr(j), IntToStr(Colors[j]), p);

WriteINI(IntToStr(i), 'Tol', IntToStr(Tol), p);
WriteINI(IntToStr(i), 'Stackable', BoolToStr(Stackable), p);

d := GetDTM(DTM);
WriteINI(IntToStr(i), 'DTM', d.ToString, p);
end;
end.

Sir R. M8gic1an

2010-11-29 04:47:03

I am pro both suggestions.

There's a file in SRL by Nava that can Auto-color during runtime. That'll be useful for walking.

Also, there's a way to make DTMs during runtime and get the string. Nielsie knows how to, and it should be somewhere in Simba's source.

Don't worry about these just yet, but they're there ;)

~RM

Gu3st...

2010-11-29 13:21:31

I love it! :)
Been thinking about this idea, but hasn't really though about it this much before…
This would also make it possible for us to make SRL Member only records if we'd want to

Nava2

2010-11-29 14:33:14

:D

This could be done so nicely in python.. Get the INI keys and then just create attributes on the object that are the same and set them too the values. :)

.. just sayin'.

Also, I've been doing this for awhile.. slow pokes. :p

NCDS

2010-11-29 15:03:43

Has my 100% support :)

Coh3n

2010-11-29 19:28:11

From: Nava2
:D

This could be done so nicely in python.. Get the INI keys and then just create attributes on the object that are the same and set them too the values. :)

.. just sayin'.

It's still very easy in Simba? Not like it's difficult. Lol.

From: Nava2

Also, I've been doing this for awhile.. slow pokes. :p

Where exactly have you been doing this? :D

Nava2

2010-11-30 04:02:20

From: Coh3n
It's still very easy in Simba? Not like it's difficult. Lol.


Where exactly have you been doing this? :D


In the miner you didn't finish >.>

Coh3n

2010-11-30 04:11:13

From: Nava2
In the miner you didn't finish >.>

Still have it. :p


program New;
//{.Include SRL/SRL/Misc/Smart.scar} <-- Remove '//' to add SMART!
{.Include SRL/SRL.scar}
{.Include SRL/SRL/Misc/Debug.scar}

{ const declarePlayers
Constants used in the declarePlayers arrays. }
const
rockTypes = 0;
dropItems = 1;

{ const Items
Constants representing the different items used throughout the script. }
const
item_Count = 4;
item_Ore = 0;
item_Clay = 1;
item_Gem = 2;
item_PickAxe = 3;
item_unkwn = -2;

{ const rockTypes
Constants representing the different rocks to mine, used in declarePlayers. }
const
rock_Count = 4;
rock_Clay = 0;
rock_Copper = 1;
rock_Tin = 2;
rock_Iron = 3;

{ const progressReport
Constants representing the elements of the progress report. }
const
report_Count = 8;
report_Clay = 0;
report_Tin = 1;
report_Copper = 2;
report_Iron = 3;
report_PerHour = 4;
report_Loads = 5;
report_Exp = 6;
report_Levels = 7;

procedure declarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

with Players[0] do
begin
Name := 'pkr navastar';
Pass := 'jackaster';
Nick := 'ava';
Active := True;
Arrays[rockTypes] := [rock_Tin, rock_Copper];
Arrays[dropItems] := [item_Ore];
end;
end;

const
Debug_All = True;
TextWait = 120;
{ Max wait time between mining ore starts and getting the ore. (Seconds) }
maxOreWait = 30;

rockWidth = 30;
rockHeight = 30;
rockMinCount = 30;
rockMaxCount = 140;

mineUpText = 'ine Rocks';
mineRandomClickChance = 7;
mineOption = 'ine Rocks';

item_color = 0;
item_dtm = 1;
item_bitmap = 2;
item_bitmapmask = 3;

gemUpText = 'ncut';
gemTypeBeginning = 'Uncut ';
gemTypeEnd = ' /';

antiBanChance = 150;

type
TItemIdent = record
IdentType, Ident: Integer;
Tols: TIntegerArray;
end;

var
rockAutoColors, newRockAutoColors: array of TAutoColorInfo;
newSetupRocks: array of Boolean;
gbl_RockCols: T2DIntegerArray;
rockBounds: TBox;
itemRefs: array of TItemIdent;
itemAmounts: TIntegerArray;
mineSearchArea: TBox;
gemNames: TStringArray;
gemCounts: TIntegerArray;

{
procedure ChangeMeToUpdate;
One of the main reasons for the structure of this script is the ease of update
associated with it. This procedure needs to be changed if colors update, or
if the user just would like to add more colours for accuracy! Or maybe want to
add a different rock to mine/drop! *cough* granite *cough* All vars are
commented thoroughly and have descriptive constants associated.
}
procedure changeMeToUpdate;
begin
{ Search area for mineRock function. }
mineSearchArea := IntToBox(MSX1, MSY2, MSX2, MSY2);
{
To update colors, replace these arrays with new values. Script will do the
the rest of the fixing. Also, colours may want to be added for accuracy.
Speed drop will be relatively insignificant.
}
gbl_RockCols :=
[
// rock_Clay
TIntegerArray([7646926, 7712720, 5273742, 6987452, 6196390, 4944005, 5669273,
6065061, 5866911, 4026765, 5676999, 5676485, 5280696]),
// rock_Copper
TIntegerArray([4550042, 3692670, 3626876, 4418199, 2769759, 2703965, 3956873,
4220305, 3495032, 4022667, 4154769, 3957132, 4418716]),
// rock_Tin
TIntegerArray([8092545, 7698043, 8421766, 9869214, 10000543, 9540248,
10329508, 10066336, 9276819, 9145490, 8618889, 9737370,
7171442]),
// rock_Iron
TIntegerArray([2963024, 2831437, 2304575, 1909556, 2502212, 2568006, 2897231,
2370368, 2765644, 2765645, 3029076, 2963025, 2699851])
];

{
All the Item identifiers. These are items that the script recognizes and
will use.
Users: If you want to add an item, feel free to, and just add it into the
drop array etc. Might require some more changes as well.
}
setLength(itemRefs, item_Count);
setLength(itemAmounts, item_Count);

itemRefs[item_Ore].IdentType := item_DTM;
itemRefs[item_Ore].Ident :=
DTMFromString('78DA63D4636660E862644006168A920CFF813' +
'448F43F10305A00D54C4055C3C0C0C4C00C5503028C7244A8D106' +
'F2A61350630DE475106157177E350020060A06');
itemRefs[item_Ore].Tols := [];

itemRefs[item_Clay].IdentType := item_dtm;
itemRefs[item_Clay].Ident :=
DTMFromString('78DA63D4616660D8C8C8800CBA4BFD1878803' +
'448F43F10301A03D5AC4355C3C0C0C4C00C5503028C5A40DE1602' +
'6A5480BC0D04D46802796B08A831C47433BA1A006E140ABB');
itemRefs[item_Clay].Tols := [];

itemRefs[item_Gem].IdentType := item_dtm;
itemRefs[item_Gem].Ident :=
DTMFromString('78DA63FCC0CCC0309F9101194CECEA62F80FA' +
'441A2FF8180F131A61A0606260616A81A1060FC0E54B38008354B' +
'09A8790B54B38A809A2740354B08A8F90454331DBF1A00F54111D' +
'B');
itemRefs[item_Gem].Tols := [];

itemRefs[item_Pickaxe].IdentType := item_dtm;
itemRefs[item_PickAxe].Ident :=
DTMFromString('78DA63FCCFC4C0D0CDC8800CAC75A418FE036' +
'990E87F2060FC0654D388AA868181898119AA06041841E6B41150' +
'C304E4B51350C305E4351350F31768D764026A403C026A00A83E0' +
'D80');
itemRefs[item_PickAxe].Tols := [];

{ Names of the Gems that can be mined.. Plus Dragonstone.. you never know ;) }
gemNames := ['sapphire', 'emerald', 'ruby', 'diamond', 'dragonstone', 'opal',
'jade', 'red topaz'];
setLength(gemCounts, Length(gemNames));
end;

procedure n2_Debug(s: String);
var
ns: String;
begin
ns := MSToTime(GetTimeRunning, Time_Bare) + ' ' + s;
if (Debug_All = True) then
Writeln(ns);
Status(ns);
end;

function inVarArray(Arr: TVariantArray; Value: Variant): Boolean;
var
h, i: Integer;
begin
h := High(Arr);
for i := 0 to h do
begin
try
Result := Arr[i] = Value;
except end;

if Result then
Exit;
end;
end;

procedure antiBan;
begin
case Random(antiBanChance) of
0: RandomRClick;
10: PickUpMouse;
20: BoredHuman;
30: ExamineInv;
40: RandomMovement;
50: HoverSkill('random', False);
60: HoverSkill('mining', False);
end;
end;

{
procedure freezeClient;
Saves the client image to a bitmap. Allows the script to read from a static
bitmap rather than a changing client. Allows for more accurate AutoColoring.
theClientHandle *must* be initiated prior to this procedure being called.
Otherwise, the handle will be lost and must be found another way.
}

var
theClientHandle: HDC;
clientBMP: Integer;

procedure freezeClient;
var
w, h: Integer;
begin
getClientDimensions(w, h);
clientBMP := BitmapFromString(w, h, '');
CopyClientToBitmap(clientBMP, 0, 0, w, h);
SetTargetBitmap(clientBMP);
end;

{
procedure unfreezeClient;
Restores the client handle to the original client, rather than the bitmap.
Frees the stored bitmap.
}
procedure unfreezeClient;
begin
SetTargetDc(theClientHandle);
FreeBitmap(clientBMP);
end;

{
procedure setAutoColors;
Just a procedure to setup some arrays used in the script.
}
procedure setAutoColors;
var
i, hi: Integer;
begin
hi := Length(gbl_RockCols);
setLength(rockAutoColors, hi);
setLength(newRockAutoColors, hi);
setLength(newSetupRocks, hi);
dec(hi);
for i := 0 to hi do
rockAutoColors[i] := CreateAutoColorInfo(gbl_RockCols[i]);
end;

{
procedure getRockColors(rock: Integer);
Create a new TAutoColorInfo based off of the colours collected in teh script.
This new TAutoColor will be exactly what is found on the MS for the current
player. Called per player.
}
const
colorLeng = 4;
colorMaxWidth = 50;
colorMaxHeight = 50;
colorMaxPercent = 0.40;
colorMinPercent = 0.20;
procedure getRockColors(rock: Integer);
var
i, hi, j, hi2, w, h, k: Integer;
aC: TAutoColorInfo;
pts: TPointArray;
sTPA: T2DPointArray;
cols, newCols: TIntegerArray;
R, G, B: Integer;
X, Y, Z: Extended;
tb: TBox;
d: Extended;
begin
aC := rockAutoColors[rock];

ColorToleranceSpeed(2);
with aC do
begin
freezeClient;
setColorSpeed2Modifiers(hueMod, satMod);
FindColorsTolerance(pts, Color, MSX1, MSY1, MSX2, MSY2, lumTol);
DebugTPA(pts, '');

sTPA := SplitTPA(pts, colorLeng);
hi2 := High(sTPA);
for j := 0 to hi2 do
begin
tb := getTPABounds(sTPA[j]);
w := tb.x2 - tb.x1 + 1;
h := tb.y2 - tb.y1 + 1;
if (w > colorMaxWidth) and (h > colorMaxHeight) then
Continue;
d := (Length(sTPA[j]) / (w * h));
//n2_Debug(FloatToStr(d) + ' density');

if (d = 1) or ((d > colorMaxPercent) and (d < colorMinPercent)) then
Continue;
cols := getColors(sTPA[j]);

ClearSameIntegers(cols);

{ Eliminate any colours that don't match the specific criteria. }
hi := High(cols);
SetLength(newCols, k + hi + 1);
for i := 0 to hi do
begin
ColorToRGB(cols[i], R, G, B);

if (R >= MinR) and (R <= MaxR) and (G >= MinG) and (G <= MaxG) and
(B >= MinB) and (B <= MaxB) then
begin
ColorToXYZ(cols[i], X, Y, Z);

if (X >= MinX) and (X <= MaxX) and (Y >= MinY) and (Y <= MaxX) and
(Z >= MinZ) and (Z <= MaxZ) then
begin
newCols[k] := cols[i];
inc(k);
end;
end;
end;
end;
end;
setLength(newCols, k);
ClearSameIntegers(newCols);
unfreezeClient;

{
Create the new TAutoColorInfo with the newly found colours. *Should* have a
much smaller tolerance associated with the colours, as well as being more
accurate/faster.
}
DebugColorArray(newCols);
newRockAutoColors[rock] := CreateAutoColorInfo(newCols);
newSetupRocks[rock] := True;
with newRockAutoColors[rock] do
begin
setColorSpeed2Modifiers(hueMod, satMod);
ColorToleranceSpeed(2);

FindColorsTolerance(pts, Color, MSX1, MSY1, MSX2, MSY2, lumTol);
end;
DebugTPA(pts, '');
end;

{
function findPickaxe: Boolean;
Finds a hatchet by first looking in the equipment interface, and if none is
found, looks in the inventory.
}
function findPickaxe: Boolean;
var
x, y, h, i, dtm_Pickaxe: Integer;
SearchLoc: TIntegerArray;
begin
if not LoggedIn then
Exit;

dtm_Pickaxe := itemRefs[item_PickAxe].Ident;
SearchLoc := [tab_Equip, tab_Inv];

h := High(SearchLoc);
for i := 0 to h do
begin
GameTab(SearchLoc[i]);

Result := FindDTM(dtm_Pickaxe, x, y, MIX1, MIY1, MIX2, MIY2);
if Result then
Break;
end;

FreeDTM(dtm_Pickaxe);
end;

{
function mineRock(var rX, rY: Integer; theRockType: Integer): Boolean;
Mines the closest rock found inside the mineSearchArea. It will try and find
all the rocks placed into the mineArr, finding the closest one.
}
function mineRock(var rX, rY: Integer; theRockType: Integer): Boolean;
var
rockI, rockLen, rockInd: Integer;
i, hi, c, j, k: Integer;
pts, rockPts: TPointArray;
sTPA: T2DPointArray;
begin
Result := False;
if not LoggedIn then Exit;
c := 0;

rockLen := High(Players[CurrentPlayer].Arrays[rockTypes]);
for rockI := 0 to rockLen do
begin
rockInd := Players[CurrentPlayer].Arrays[rockTypes][rockI];
{ Make sure the current rock Colour info is set up. }
if not newSetupRocks[rockInd] then
getRockColors(rockInd);

with newRockAutoColors[rockInd] do
begin
setColorSpeed2Modifiers(hueMod, satMod);
ColorToleranceSpeed(2);

FindColorsTolerance(pts, Color, MSX1, MSY1, MSX2, MSY2, lumTol);
end;

{ Create an ATPA of the individual rocks. }
sTPA := TPAToATPAEx(pts, rockWidth, rockHeight);
DebugATPA(sTPA, '');

hi := High(sTPA);
setLength(rockPts, c + hi + 1);
for i := 0 to hi do
begin
//n2_Debug(IntToStr(Length(sTPA[i])));
{ If the rocks are within the min and max count, add the middle point. }
if InRange(Length(sTPA[i]), rockMinCount, rockMaxCount) then
begin
rockPts[c] := MiddleTPA(sTPA[i]);
inc(c);
end;
end;
end;

{ Sort the new TPA of Suitable rocks by closest to the player. }
setLength(rockPts, c);
SortTPAFrom(rockPts, Point(MSCX, MSCY));
//DebugTPA(rockPts, '');
n2_Debug('Found ' + IntToStr(Length(rockPts)) + ' rocks.');
dec(c);

{ Cycle through the points, make sure the uptext is valid. Click! }
for i := 0 to c do
begin
MMouse(rockPts[i].x, rockPts[i].y, 4, 4);
if WaitUpText(mineUpText, TextWait) then
begin
//n2_Debug('Found: ' + getUpText);
getMousePos(rX, rY);
if (Random(mineRandomClickChance) = 0) then
begin
Mouse(rX, rY, 0, 0, False);
WaitOption(mineOption, TextWait);
end else
Mouse(rX, rY, 0, 0, True);
Result := True;
{
Create the bounds in which the rock will be found. This is used in
rockPresent.
}
j := rockWidth div 2;
k := rockHeight div 2;
rockBounds := IntToBox(rX - j, rY - k, rX + j, rY + k);
end;
Break;
end;

SetColorSpeed2Modifiers(0.2, 0.2);
end;

{
function rockPresent(theRockType: Integer): Boolean;
Checks for the presence of the rock in the rockBounds created in mineRock.
Uses the TAutoColorInfo for the rock type.
}
function rockPresent(theRockType: Integer): Boolean;
var
pts: TPointArray;
begin
Result := False;
if not LoggedIn then Exit;

with newRockAutoColors[theRockType] do
begin
setColorSpeed2Modifiers(hueMod, satMod);
ColorToleranceSpeed(2);

FindColorsTolerance(pts, Color, rockBounds.x1, rockBounds.y1,
rockBounds.x2, rockBounds.y2, lumTol);
end;

Result := (InRange(Length(Pts), rockMinCount, rockMaxCount));
setColorSpeed2Modifiers(0.2, 0.2);
end;

{
procedure WaitWhileMining(fx, fy, theRockType: Integer);
Waits while mining rock of type theRockType. It preforms several checks from
inventory, to object finding.
}
procedure waitWhileMining(fx, fy, theRockType: Integer);
var
sOreCount, itemInd, timeOut: Integer;
begin
if (theRockType = rock_Clay) then
itemInd := item_Clay
else
itemInd := item_Ore;

{
Get and initial ore count, while the count is the same and the rock is still
found on the mainscreen, wait antiban etc. Has a timeout as a last measure.
}
timeOut := getTimeRunning + (maxOreWait * 1000);
sOreCount := CountItems('dtm', ItemRefs[itemInd].Ident, []);
while ((CountItems('dtm', ItemRefs[itemInd].Ident, []) = sOreCount) and
(rockPresent(theRockType)) and (timeOut > getTimeRunning)) do
begin
antiBan;

if LevelUp then
begin
Players[CurrentPlayer].Integers[report_Levels] := Players[CurrentPlayer].Integers[report_Levels] + 1;
GameTab(tab_Stats);
HoverSkill('mining', True);
GameTab(tab_Inv);
end;

Wait(100 + Random(50));
end;
end;
{
function newFindItemMultiEx(var x, y: Integer; ItemArr: array of TItemIdent;
Area: TBox; var Which: Integer): Boolean;
Finds the first occurange from the ItemArr and returns the x, y coords
respectively. Also returns the index of the itemArr found.
}
function newFindItemMultiEx(var x, y: Integer; ItemArr: array of TItemIdent;
Area: TBox; var Which: Integer): Boolean;
var
Pts: TPointArray;
i, hi: Integer;
begin
Result := False;
hi := High(itemArr);
for i := 0 to hi do
begin
with itemArr[i] do
{ Dependant on what identType is passed, preform the necessary function. }
case IdentType of
item_bitmapmask:
begin
SetLength(Tols, 2);
Result := FindBitmapMaskTolerance(Ident, x, y, Area.x1, Area.y1,
Area.x2, Area.y2, Tols[0], Tols[1]);
end;
item_bitmap:
Result := FindTransparentBitmapTolerance(Ident, x, y, 0,
Area.x1, Area.y1,
Area.x2, Area.y2, Tols[0]);
item_dtm:
Result := FindDTM(Ident, x, y, Area.x1, Area.y1, Area.x2, Area.y2);
item_color:
begin
SetLength(Tols, 2);
FindColorsTolerance(Pts, Ident, Area.x1, Area.y1,
Area.x2, Area.y2, Tols[0]);
if Tols[1] < 1 then Tols[1] := 1;
Result := Length(Pts) >= Tols[1];
if Result then
MiddleTPAEx(Pts, x, y);
end;
else
SRL_Warn('FindItem', 'Invalid identifier ''' + IntToStr(IdentType)
+ ''' input as IdentType.', -1);
end;
if Result then
begin
Which := i;
Exit;
end;
end;
Which := -1;
end;

{
Returns the name of the gem at `slot'.
}
function getGemType(slot: Integer): Integer;
var
s: String;
i: Integer;
begin
MMouseItem(slot);
waitUpText(gemUpText, TextWait);
s := getUpText;
s := lowerCase(between(gemTypeBeginning, gemTypeEnd, s));
slot := High(gemNames);
for i := 0 to slot do
if (s = gemNames[i]) then
Break;
Result := i;
end;

var
invArr: TIntegerArray;

{
procedure invManagement;
Created to manage the inventory. Completes tasks such as dropping, organizing
and counting of items.
}
procedure invManagement;
var
i, j, fx, fy: Integer;
dropArr: TIntegerArray;
begin
if not LoggedIn then Exit;

n2_Debug('Initiating Inventory management.');
dropArr := Players[currentPlayer].Arrays[dropItems];
for i := 1 to 28 do
begin
{
if we have no record of the item, and the item exists, get what type of
item it is and increase the count per item.
}
if (invArr[i] = -1) and (existsItem(i)) then
begin
newFindItemMultiEx(fx, fy, itemRefs, InvBox(i), invArr[i]);
if (invArr[i] = -1) then
invArr[i] := item_unkwn;
if (invArr[i] = item_Gem) then
Inc(gemCounts[getGemType(i)])
else
if (invArr[i] <> item_unkwn) then
inc(itemAmounts[invArr[i]]);
end;

{ Check if the current item is part of the players dropping array. }
if InIntArray(dropArr, invArr[i]) then
begin
MouseItem(i, False);
waitOption('rop', TextWait);
inc(itemAmounts[invArr[i]]);
invArr[i] := -1;
end else
{
if the item is not to be dropped, and to be kept, lets put it at
the end of the inventory.
}
if InIntArray([item_Gem, item_PickAxe, item_unkwn], invArr[i])
and (not InvFull) then
begin
n2_Debug('Found an item to be kept, attempting to move the gem.');
for j := 28 to 1 do
if not InIntArray([item_Gem, item_PickAxe, item_unkwn], invArr[i]) then
begin
MMouseItem(i);
Wait(RandomRange(100, 200));
GetMousePos(fx, fy);
HoldMouse(fx, fy, True);
MMouseItem(j);
Wait(RandomRange(100, 200));
GetMousePos(fx, fy);
ReleaseMouse(fx, fy, True);
swap(invArr[i], invArr[j]);
Break;
end;
end;
end;
if (invFull) then
begin
LogOut;
n2_Debug('Player[' + IntToStr(CurrentPlayer) + '] is now inactive. ' +
'Inventory is full and cannot mine any more.');
n2_Debug('Perhaps, try adding more items into the Drop array, item_unkwn too.');
Players[CurrentPlayer].Loc := 'Inventory is full.';
end;

end;

{
function groupDigits(n: integer; token: String): String;
By: PriSoner and Nava2
Formats an integer into groups of 3 seperated by `token' and returns a
formatted string. i.e "1234567" would become "1,234,567".
}
function groupDigits(n: integer; token: String): String;
var
b: integer;
begin
Result := IntToStr(n);
b := length(Result) + 1;
if b > 3 then
repeat
b := b - 3;
if b > 1 then
insert(token, Result, b);
until (b < 3);
end;

procedure printReport;
var
k, j: Byte;
Arr, rArr: Array[0..report_Count - 1] of String;
reportText: Array[0..1] of TStringArray;
longestLen, whichOre: String;
begin
Writeln('{ ------------------------------------------------------------------- }');
Writeln('{ Nava2 & Coh3n''s PowerMiner }');
Writeln('{ ------------------------------------------------------------------- }');
Writeln(PadR('{ Time Running: ' + TimeRunning + '.', 70) + '}');
Writeln('{ ------------------------------------------------------------------- }');
Writeln('{ }');

longestLen := groupDigits(Players[CurrentPlayer].Integers[report_Exp], ',');

{
Cycle through all the different parts of the report_Count. This will make the
progressreport output them a certain way.
}
for j := 0 to (report_Count - 1) do
begin
Arr[j] := groupDigits(Players[CurrentPlayer].Integers[j], ',');
rArr[j] := Arr[j] + PadR('', ((Length(longestLen) + 1) - Length(Arr[j])));

if (HowManyPlayers = 1) then
begin
case j of
report_Clay..report_Iron:
begin
case j of
rock_Clay: whichOre := 'clay lumps.';
rock_Copper: whichOre := 'copper ore.';
rock_Tin: whichOre := 'tin ore.';
rock_Iron: whichOre := 'iron ore.';
else
n2_Debug('Invalid rockType in declarePlayers.');
end;

if InVarArray(Players[CurrentPlayer].Arrays[rockTypes], j) then
Writeln(PadR('{ ** Mined ' + rArr[j] + whichOre ,
70) + '}');
end;

report_PerHour..(report_Count - 1):
begin
reportText[0] := ['Mined ', 'Dropped ', 'Gained ', 'Gained '];
reportText[1] := ['rocks per hour.', 'loads.', 'mining experience.',
'mining levels.'];

k := j - 4;
Writeln(PadR('{ ** ' + reportText[0][k] + rArr[j] +
reportText[1][k], 70) + '}');
end;
end;
end;
end;

Writeln('{ }');
Writeln('{ ------------------------------------------------------------------- }');
Writeln('{ ------------------------------------------------------------------- }');
end;

{
procedure setupPlayer;
Sets up the player to start autoing.
}
procedure setupPlayer;
begin
SetAngle(True);

if findPickaxe then
Writeln('Found Pickaxe!')
else
begin
n2_Debug('Error finding pickaxe, logging out. ');
Logout;
n2_Debug('Player[' + IntToStr(CurrentPlayer) + '] is now inactive. ');
end;

Writeln('Current Mining Level: ' + IntToStr(GetSkillLevel('mining')) + '.');
end;

procedure scriptTerminate;
begin
printReport;
end;

var
x, y, r: Integer;
begin
SetupSRL;
DeclarePlayers;
ChangeMeToUpdate;
GraphicsSet := True;
LoginPlayer;
theClientHandle := GetTargetDC;
setAutoColors;

setupPlayer;
h := High(Players[CurrentPlayer].Arrays[rockTypes]);
for i := 0 to h do
mineRock(x, y, Players[CurrentPlayer].Arrays[rockTypes].[i]);

end.
It just looks like it's easy to update, not automatically updated.

Coh3n

2010-12-15 19:56:34

Moved to public. :)

Sex

2010-12-15 23:25:07

Uptext0=onze pi     // If there's another way to do arrays, I'd love to know
Uptext1=ze pick
Can't you just do like Uptext=test1,test2,test3 and then explode it?
e.g
Object.Uptext := Explode(',', ReadINI('10', 'uptext', INIPath));    

i luffs yeww

2010-12-15 23:31:36

^ e.g.*, and yeah, you could do that, I think.

Coh3n

2010-12-16 00:32:45

From: Sex
Uptext0=onze pi     // If there's another way to do arrays, I'd love to know
Uptext1=ze pick
Can't you just do like Uptext=test1,test2,test3 and then explode it?
e.g
Object.Uptext := Explode(',', ReadINI('10', 'uptext', INIPath));    

Will that just put what's between the commas in the array? If so then yeah, that would work nicely. :)

i luffs yeww

2010-12-16 00:38:06

Yes.

Coh3n

2010-12-16 01:08:25

From: i luffs yeww
Yes.

Perfect, I'll update the first post when I have more time, or if someone wants to update the code, be my guest. ;)

Sex

2010-12-16 01:44:40

var
i, j: Integer;
p: string;
d: TMDTM;
begin
ClearDebug;

AddOnTerminate('MSI_ScriptTerminate');
SetScriptProp(SP_WriteTimeStamp, [True]);

Smart_Server := WORLD_SMART;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ActivateClient;

SetupSRL;
SetupMSI;

{$IFDEF REFLECTION}
// So if the hooks are outdated, the script will attempt colour walking if the points exist
if (not MSI_SetupReflection(False)) then
ReflectionBroken := True;
{$ELSE}
ReflectionBroken := True; // Set to true because it's not even being used
{$ENDIF}

if (ReflectionBroken) then
ShowMessage('WARNING: Reflection hooks are outdated!');

Stats_UserID := STATS_ID;
Stats_Password := STATS_PASS;
Stats_ScriptID := '47';
CurrDebugLevel := 1;

DeclarePlayers;
//MSI_Mainloop;

p := IncludePath+'MSI\Items.txt';
for i := 0 to High(MSI_Items) do
with MSI_Items[i] do
if (Name <> '') then
begin
WriteINI(IntToStr(i), 'Name', Name, p);
WriteINI(IntToStr(i), 'Uptext', Implode(',', Uptext), p);
WriteINI(IntToStr(i), 'Colors', Implode(',', Colors), p);
WriteINI(IntToStr(i), 'Tol', IntToStr(Tol), p);
WriteINI(IntToStr(i), 'Stackable', BoolToStr(Stackable), p);
d := GetDTM(DTM);
WriteINI(IntToStr(i), 'DTM', d.ToString, p);
end;
end.
Did it for colors as well as they were saved in similar format. I don't have the code from where you read the INI if you post the snippet I will gladly edit it :p. I don't have Ref or anything on here.

Frement

2010-12-16 01:45:05

EDIT: Ninja'd ;)

Coh3n

2010-12-16 09:50:18

Thanks! :) And I didn't write any code to Read from the file, I was just using the writing as a proof of concept.

Sex

2010-12-16 15:19:52

Oh, :p. If you post the structure of the object records I can create the code to read it for you.

Coh3n

2010-12-16 18:37:50

From: Sex
Oh, :p. If you post the structure of the object records I can create the code to read it for you.


TREE_NORMAL:
with MSI_Objects[whichObject] do
begin
Name := 'Normal tree';
UpText := 'Tree';
Option := 'down Tree';
Colors := [4094829];
Tol := 10;
Hue := 0.05;
Sat := 0.62;
FindAllColors := False;
W := 35;
H := 35;
Accuracy := 20;
ExcludeSelf := True;
RightClickOnly := False;
Tries := 5;
Anim := False;
WaitToMove := True;
BadColors := [];
BadColorTolerance := 10;
AssociatedItems := [LOGS_NORMAL];
end;
:)

I'm still not sure about the DTMs for items because I don't think they can be automatically updated very accurately (at least I know that's the case for some items).

Sex

2010-12-17 03:00:35

Do you want all of those details saved? Do you want a function to load each entry or something? How are they gonna be saved (section names, etc.). Message me on MSN so we can talk more about this; I'm sure you already have me.

Coh3n

2010-12-17 15:43:23

From: Sex
Do you want all of those details saved? Do you want a function to load each entry or something? How are they gonna be saved (section names, etc.). Message me on MSN so we can talk more about this; I'm sure you already have me.

It'd be the exact same as items, except with the object attributes.

E: This is a nice idea, but realistically I don't see it working like we want, nor it being implemented for quite some time. I'm marking it as denied.