Dead-Inside Posted February 3, 2007 Share Posted February 3, 2007 Right, I'm trying to do personal racestimes per map. I want two things; first of all I want my .ini files in a folder called records. I haven't managed to do this. Secondly, I need custom filenames based on playernames. Every time a person finishes a map and gets a time, I want it to write in the file with his name, under the race name. I haven't managed to do this. I even tried, failing the above, to keep it all in one file but I still failed to create headlines for playernames to keep the maps and times under. Apart from this, I haven't found any functionlisting anywhere? gettok, iif, replace, etc, I haven't found any description of them anywhere apart from iif on wikipedia... Anyone have a linky for me? Thanks, Dead-Inside Link to comment
Scooby Posted February 4, 2007 Share Posted February 4, 2007 Right, I'm trying to do personal racestimes per map.I want two things; first of all I want my .ini files in a folder called records. I haven't managed to do this. Secondly, I need custom filenames based on playernames. Every time a person finishes a map and gets a time, I want it to write in the file with his name, under the race name. I haven't managed to do this. I even tried, failing the above, to keep it all in one file but I still failed to create headlines for playernames to keep the maps and times under. Apart from this, I haven't found any functionlisting anywhere? gettok, iif, replace, etc, I haven't found any description of them anywhere apart from iif on wikipedia... Anyone have a linky for me? Thanks, Dead-Inside all u need do is save the data to the ini in the format: nick + race name = time u can specify the location in the line that reads and writes this: !writeini -n " $+ $scriptdir $+ times.ini" followed by ur info this will save all times to 1 ini, from what ur saying u want to have 1 file per map? not sure why, since u can add it all to 1 file, ur gonna end up with 100's of ini's. if this is still a little beyond ur skills, or youre still not sure what to do, u can add my msn and i'l help u out from there. [email protected] Link to comment
Squall Posted February 5, 2007 Share Posted February 5, 2007 all u need do is save the data to the ini in the format: nick + race name = time u can specify the location in the line that reads and writes this: !writeini -n " $+ $scriptdir $+ times.ini" followed by ur info actually its !writeini -n " $+ $scriptdir $+ records\$mta.nick($1,$2).ini" blah blah blah too of wat i saw Link to comment
Dead-Inside Posted February 5, 2007 Author Share Posted February 5, 2007 Please don't tell me I just forwardslashed and it should have been backwardslash? Because otherwise that's exactly what I did. Anyway, if I can't get that working again I'll add you to MSN, thanks. Link to comment
Dead-Inside Posted February 5, 2007 Author Share Posted February 5, 2007 Right, so I'm probably going to get this working with a single file but that wasn't my intent. At least I understand how the hell I can set it up to work properly now. Anyway, when doing !writeini -n " $+ $scriptdir $+ records\$mta.nick($1,$2).ini" it actually types $mta.nick($1,$2).ini as the file name. Should be a way around that I recon but I'm clueless as to how so I'm not even going to try. I am, however, going to ask if anyone knows? Link to comment
Scooby Posted February 6, 2007 Share Posted February 6, 2007 Right, so I'm probably going to get this working with a single file but that wasn't my intent.At least I understand how the hell I can set it up to work properly now. Anyway, when doing !writeini -n " $+ $scriptdir $+ records\$mta.nick($1,$2).ini" it actually types $mta.nick($1,$2).ini as the file name. Should be a way around that I recon but I'm clueless as to how so I'm not even going to try. I am, however, going to ask if anyone knows? yea u just need to add a $+ between the backslash and the $mta.nick !writeini -n " $+ $scriptdirrecords\ $+ $mta.nick($1,$2).ini" race mapname time that should do the trick and get u individual ini's per player in the folder named records. Link to comment
Dead-Inside Posted February 6, 2007 Author Share Posted February 6, 2007 It didn't. And I'm not liking mIRC scripting. It's not doing what I'm telling it to because it's being stubborn so I have to work around it. I am making progress though. Link to comment
Scooby Posted February 6, 2007 Share Posted February 6, 2007 It didn't.And I'm not liking mIRC scripting. It's not doing what I'm telling it to because it's being stubborn so I have to work around it. I am making progress though. sry my bad, u need to also add a $+ between $mta.nick($1,$2) and .ini so its: !writeini -n " $+ $scriptdirrecords\ $+ $mta.nick($1,$2) $+ .ini" race mapname time have fun:) Link to comment
Dead-Inside Posted February 6, 2007 Author Share Posted February 6, 2007 Doesn't matter. Already have it up and running, logging to two files though. I have another question. How would I call to get the time of my server? I'd like a !time command that gives the server clock As I said I have no access to any lists so . Also, would set %i = $calc($gettok($readini($scriptdir $+ records\myfilename.ini,$mta.nick($1,$2),$replace($mta.race($1),$chr(32),-)),1,32) - $mta.time($1,$2)) work like I suppose it would? I'd like the mid-time number so that I can tell people how far away they were from the record. Last time I tried I did something completely different and it didn't work, I'm assuming the above would though? Link to comment
Scooby Posted February 7, 2007 Share Posted February 7, 2007 Doesn't matter. Already have it up and running, logging to two files though.I have another question. How would I call to get the time of my server? I'd like a !time command that gives the server clock As I said I have no access to any lists so . Also, would set %i = $calc($gettok($readini($scriptdir $+ records\myfilename.ini,$mta.nick($1,$2),$replace($mta.race($1),$chr(32),-)),1,32) - $mta.time($1,$2)) work like I suppose it would? I'd like the mid-time number so that I can tell people how far away they were from the record. Last time I tried I did something completely different and it didn't work, I'm assuming the above would though? u can use $time to show current time if thats what u mean like: if ($3 == !time) mta.text $1 The Time is: $time im not sure how ur time is stored in ur ini, im guessing its like 1min 45secs - but even if u store both time format and ticks format, i dont think theres a way of returning an exact split time unless u write an alias to do that. u can of course return a time down to the exact second, but ur calc is wrong. $mta.time($1,$2) will return the current ticks since the start of the race, and ur using the info in the ini which i think is stored in time format it is possible to do what ur trying tho, but only down to the second using that format. all u need to do is split ur stored time like u have done, but also split ur current time then work out the difference. which u could do in a seperate alias. in my script i store all time in ticks format, so i can just calc 1 from the other, then i have my own alias that converts ticks into time down to 1/100th second. eg: u finsish a race with the time 1:30.555 and ur best ever might be 1:30.554 so it would show ur split time as +0:00:001 im not sure what info u store to ur ini, and talking like this on the forums could take u days/weeks to get it right its all kinda hard to explain on a forum, so if u do wanna go ahead, just add my msn and i'll help u thru it or sort u out one way or another. also, u said u have no access to any lists? have u looked in mirc help files? also the SA-scripting.html file that came with mtama? they are the only lists we all use and u have access to both... im sure:) Link to comment
Dead-Inside Posted February 7, 2007 Author Share Posted February 7, 2007 I was just wondering if my calculation would work. The values are correct (As in they're both the same raw format in ticks and no mins/secs or : . formatting). For displaying I'm using an 00:00:000 setup, a la Mictech, which was the server I used to play on. In any case, I'm assuming then that what I typed should work just fine? Link to comment
Scooby Posted February 7, 2007 Share Posted February 7, 2007 I was just wondering if my calculation would work.The values are correct (As in they're both the same raw format in ticks and no mins/secs or : . formatting). For displaying I'm using an 00:00:000 setup, a la Mictech, which was the server I used to play on. In any case, I'm assuming then that what I typed should work just fine? so the info u get from ur ini is in ticks? if so then yes it would work. but u would need to convert it to a time format to display. wouldnt it have been quicker to just try it? Link to comment
Dead-Inside Posted February 7, 2007 Author Share Posted February 7, 2007 Well it was what I was going to do next, which would be now and not then. I'll probably have more questions later, but for now I should be alright. Thanks. And, btw, I already have a time converter . Link to comment
Scooby Posted February 7, 2007 Share Posted February 7, 2007 ok good luck. also if u do have any more questions and need a quicker answer, im usually on the #mta.scripting channel on irc. (irc.multitheftauto.com) Link to comment
Recommended Posts