############################################################################# # Test script LFSREST_API by Bass-Driver (Dan190NL) ############################################################################# # # This is a test script to retrieve information about the requested mod # #Possible variables /* #vehicle info $modinfo["status"] $modinfo["id"] $modinfo["name"] $modinfo["descriptionshort"] $modinfo["description"] $modinfo["userid"] $modinfo["currusage"] $modinfo["username"] $modinfo["wip"] $modinfo["publishedat"] $modinfo["rating"] $modinfo["numratings"] $modinfo["numdownloads"] $modinfo["version"] $modinfo["lastdownloadedat"] $modinfo["class"] $modinfo["ev"] $modinfo["tweakmod"] $modinfo["staffpick"] #Detailed vehicle info $modinfo["icecc"] $modinfo["icenumcylinders"] $modinfo["icelayout"] $modinfo["evredLine"] $modinfo["drive"] $modinfo["shifttype"] $modinfo["power"] $modinfo["maxpowerrpm"] $modinfo["mass"] $modinfo["bhp"] $modinfo["powerweightratio"] $modinfo["bhpton"] $modinfo["fueltanksize"] */ ############################################################################# CatchEvent OnMSO( $userName, $text ) # Player event $idxOfFirtsSpace = indexOf( $text, " "); IF( $idxOfFirtsSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirtsSpace ); $argv = trim( subStr( $text,$idxOfFirtsSpace ) ); ENDIF SWITCH( $command ) #Simulate Start/Finish Race CASE "!modinfo": GetModInfo($userName,$argv); BREAK; ENDSWITCH EndCatchEvent Sub GetModInfo($userName,$argv) $starthgt = 40; $startwgt = 54; IF($argv == "")THEN $modinfo = getmoddedcarinfo($userName); ELSE $modinfo = getmoddedcarinfo($argv); ENDIF privmsg("Status: ".$modinfo["status"]); openPrivButton("MI_bgd",$startwgt-1,$starthgt-1,95,74,10,-1,32,""); openPrivButton("MI_title",$startwgt,$starthgt,93,5,10,-1,32,"^7Modinfo from ".getplayervar($userName,"NickName")); #Title Info of vehicle openPrivButton("MI_id_title",$startwgt,$starthgt+6,16,4,10,-1,80,"^0Car ID:"); openPrivButton("MI_name_title",$startwgt,$starthgt+10,16,4,10,-1,80,"^0Car Name:"); openPrivButton("MI_descshort_title",$startwgt,$starthgt+14,16,4,10,-1,80,"^0Description Short:"); openPrivButton("MI_user_title",$startwgt,$starthgt+18,16,4,10,-1,80,"^0User of Publisher:"); openPrivButton("MI_wip_title",$startwgt,$starthgt+22,16,4,10,-1,80,"^0WIP:"); openPrivButton("MI_DateOfPublish_title",$startwgt,$starthgt+26,16,4,10,-1,80,"^0Date Of Publish:"); openPrivButton("MI_rating_title",$startwgt,$starthgt+30,16,4,10,-1,80,"^0Rating:"); openPrivButton("MI_numrating_title",$startwgt,$starthgt+34,16,4,10,-1,80,"^0Num of Ratings:"); openPrivButton("MI_nrofdl_title",$startwgt,$starthgt+38,16,4,10,-1,80,"^0Num of downloads:"); openPrivButton("MI_version_title",$startwgt,$starthgt+42,16,4,10,-1,80,"^0Version:"); openPrivButton("MI_LastDL_title",$startwgt,$starthgt+46,16,4,10,-1,80,"^0Last Downloaded:"); openPrivButton("MI_Class_title",$startwgt,$starthgt+50,16,4,10,-1,80,"^0Class:"); openPrivButton("MI_EV_title",$startwgt,$starthgt+54,16,4,10,-1,80,"^0Electric:"); openPrivButton("MI_tweak_title",$startwgt,$starthgt+58,16,4,10,-1,80,"^0tweakmod:"); openPrivButton("MI_staffpick_title",$startwgt,$starthgt+62,16,4,10,-1,80,"^0staffpick:"); #Values info of vehicle openPrivButton("MI_id",$startwgt+16,$starthgt+6,30,4,10,-1,80,"^0".$modinfo["id"]); openPrivButton("MI_name",$startwgt+16,$starthgt+10,30,4,10,-1,80,"^0".$modinfo["name"]); openPrivButton("MI_descshort",$startwgt+16,$starthgt+14,30,4,10,-1,80,"^0".$modinfo["descriptionshort"]); openPrivButton("MI_user",$startwgt+16,$starthgt+18,30,4,10,-1,80,"^0".$modinfo["username"]); openPrivButton("MI_wip",$startwgt+16,$starthgt+22,30,4,10,-1,80,"^0".$modinfo["wip"]); openPrivButton("MI_DateOfPublish",$startwgt+16,$starthgt+26,30,4,10,-1,80,"^0".$modinfo["publishedat"]); openPrivButton("MI_rating",$startwgt+16,$starthgt+30,30,4,10,-1,80,"^0".$modinfo["rating"]); openPrivButton("MI_numrating",$startwgt+16,$starthgt+34,30,4,10,-1,80,"^0".$modinfo["numratings"]); openPrivButton("MI_nrofdl",$startwgt+16,$starthgt+38,30,4,10,-1,80,"^0".$modinfo["numdownloads"]); openPrivButton("MI_version",$startwgt+16,$starthgt+42,30,4,10,-1,80,"^0".$modinfo["version"]); openPrivButton("MI_LastDL",$startwgt+16,$starthgt+46,30,4,10,-1,80,"^0".$modinfo["lastdownloadedat"]); openPrivButton("MI_Class",$startwgt+16,$starthgt+50,30,4,10,-1,80,"^0".$modinfo["class"]); openPrivButton("MI_EV",$startwgt+16,$starthgt+54,30,4,10,-1,80,"^0".$modinfo["ev"]); openPrivButton("MI_tweak",$startwgt+16,$starthgt+58,30,4,10,-1,80,"^0".$modinfo["tweakmod"]); openPrivButton("MI_staffpick",$startwgt+16,$starthgt+62,30,4,10,-1,80,"^0".$modinfo["staffpick"]); #Title detailed info of vehicle openPrivButton("MI_size_title",$startwgt+47,$starthgt+6,16,4,10,-1,80,"^0Engine size:"); openPrivButton("MI_numofcylinders_title",$startwgt+47,$starthgt+10,16,4,10,-1,80,"^0Num of Cylinders:"); openPrivButton("MI_layout_title",$startwgt+47,$starthgt+14,16,4,10,-1,80,"^0Engine Layout:"); openPrivButton("MI_redline_title",$startwgt+47,$starthgt+18,16,4,10,-1,80,"^0Max Electric Redline:"); openPrivButton("MI_drivetrain_title",$startwgt+47,$starthgt+22,16,4,10,-1,80,"^0Type of Drivetrain:"); openPrivButton("MI_shifttype_title",$startwgt+47,$starthgt+26,16,4,10,-1,80,"^0Shifttype:"); openPrivButton("MI_power_title",$startwgt+47,$starthgt+30,16,4,10,-1,80,"^0Power in KW"); openPrivButton("MI_maxpower_title",$startwgt+47,$starthgt+34,16,4,10,-1,80,"^0Max power @ RPM:"); openPrivButton("MI_mass_title",$startwgt+47,$starthgt+38,16,4,10,-1,80,"^0Mass:"); openPrivButton("MI_bhp_title",$startwgt+47,$starthgt+42,16,4,10,-1,80,"^0Brake horsepower (bhp):"); openPrivButton("MI_pwr_title",$startwgt+47,$starthgt+46,16,4,10,-1,80,"^0Power Weight Ratio:"); openPrivButton("MI_bhpton_title",$startwgt+47,$starthgt+50,16,4,10,-1,80,"^0Bhp / Ton:"); openPrivButton("MI_tanksize_title",$startwgt+47,$starthgt+54,16,4,10,-1,80,"^0Tank size:"); #Values detailed info of vehicle openPrivButton("MI_size",$startwgt+63,$starthgt+6,30,4,10,-1,80,"^0".$modinfo["icecc"]); openPrivButton("MI_numofcylinders",$startwgt+63,$starthgt+10,30,4,10,-1,80,"^0".$modinfo["icenumcylinders"]); openPrivButton("MI_layout",$startwgt+63,$starthgt+14,30,4,10,-1,80,"^0".$modinfo["icelayout"]); openPrivButton("MI_redline",$startwgt+63,$starthgt+18,30,4,10,-1,80,"^0".$modinfo["evredLine"]); openPrivButton("MI_drivetrain",$startwgt+63,$starthgt+22,30,4,10,-1,80,"^0".$modinfo["drive"]); openPrivButton("MI_shifttype",$startwgt+63,$starthgt+26,30,4,10,-1,80,"^0".$modinfo["shifttype"]); openPrivButton("MI_power",$startwgt+63,$starthgt+30,30,4,10,-1,80,"^0".$modinfo["power"]); openPrivButton("MI_maxpower",$startwgt+63,$starthgt+34,30,4,10,-1,80,"^0".$modinfo["maxpowerrpm"]); openPrivButton("MI_mass",$startwgt+63,$starthgt+38,30,4,10,-1,80,"^0".$modinfo["mass"]); openPrivButton("MI_bhp",$startwgt+63,$starthgt+42,30,4,10,-1,80,"^0".$modinfo["bhp"]); openPrivButton("MI_pwr",$startwgt+63,$starthgt+46,30,4,10,-1,80,"^0".$modinfo["powerweightratio"]); openPrivButton("MI_bhpton",$startwgt+63,$starthgt+50,30,4,10,-1,80,"^0".$modinfo["bhpton"]); openPrivButton("MI_tanksize",$startwgt+63,$starthgt+54,30,4,10,-1,80,"^0".$modinfo["fueltanksize"]); openPrivButton("MI_close",$startwgt,$starthgt+67,93,5,10,-1,32,"^3CLOSE",closemodinfo); EndSub Sub closemodinfo($keyflags,$id) $userName = getcurrentplayervar("UserName"); closeButtonRegex ( $userName, "MI_"); EndSub