{"id":19849164,"url":"https://github.com/salmmanfred/ccdb-script","last_synced_at":"2025-02-28T20:40:47.220Z","repository":{"id":57543813,"uuid":"367175495","full_name":"salmmanfred/ccdb-script","owner":"salmmanfred","description":"A light language for rust when you want your game or project to easily be moddable.","archived":false,"fork":false,"pushed_at":"2021-06-23T11:45:53.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T07:56:14.450Z","etag":null,"topics":["emb","interpreter","langauge","modding","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salmmanfred.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-13T21:10:43.000Z","updated_at":"2021-09-01T17:40:29.000Z","dependencies_parsed_at":"2022-08-27T19:10:36.330Z","dependency_job_id":null,"html_url":"https://github.com/salmmanfred/ccdb-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmmanfred%2Fccdb-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmmanfred%2Fccdb-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmmanfred%2Fccdb-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmmanfred%2Fccdb-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salmmanfred","download_url":"https://codeload.github.com/salmmanfred/ccdb-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241228649,"owners_count":19930645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emb","interpreter","langauge","modding","rust","rust-library"],"created_at":"2024-11-12T13:19:32.567Z","updated_at":"2025-02-28T20:40:47.191Z","avatar_url":"https://github.com/salmmanfred.png","language":"Rust","readme":"# CCDB_SCRIPT  \n  \nWhy ccdb-script?  \n  \nA light language for rust when you want your game or project to easily be moddable.\n  \n## ccdb_script is light  \n  \nas said ccdb_script is made to be light  \n\n## ccdb_script is easy  \n  \nccdb_script is made to be easy to integrate into any given project  \n  \n## How to integrate  \n  \n```rust\n// ! note this example uses my other crate openfile \nuse ccdb_script;\n/* The test ccdb-script \n[(var)test \"test\"]\n*/\nfn main(){\n    ccdb_script::run(openfile::readFile(\"test.ccdbs\")); // you can also get val from this\n    let parse = ccdb_script::parse(openfile::readFile(\"test.ccdbs\")); // if you split it up this way you only need to parse once and then \n    // you can still easily run the script whenever you want to \n    let mut val = ccdb_script::run_parsed(parse);\n    println!(\"{}\",val.get_var(\"test\".to_string()));\n\n    // create a custom struct. This is used for custom functions in the script that are linked to rust\n    let mut custom = ccdb_script::custom::Custom::new();\n    //sample function ALL custom functions need Vec\u003cString\u003e and -\u003e String as their only in and outputs\n  \n    fn test(x: Vec\u003cString\u003e) -\u003e String{\n        println!(\"{:#?}\",x);\n        \"test\".to_string()\n    }\n    fn test2(x: Vec\u003cString\u003e){\n        println!(\"no output{:#?}\",x);\n       \n    }\n     fn test3(x: \u0026mut ccdb_script::var::Var){\n       \n        print!(\"vv{:#?}\",x.var);\n        x.new_var(\"lol\",\"yes\");\n       \n    }\n    custom.new_fn(ccdb_script::custom::FnType::Output(test),\"test\");//with output \n    custom.new_fn(ccdb_script::custom::FnType::Nout(test2),\"test2\");//without output\n    custom.new_fn(ccdb_script::custom::FnType::Var(test3),\"test3\");//to get access to var values\n\n// add it to the script\n    // the output will be R(function name) with no ()\n    // if you want custom values when running the script;\n    let mut var = ccdb_script::var::Var::new();\n    var.new_var(\"name\",\"value\");\n    var.set_max_mem(100); // set the max number of bytes the script is allowed to use if you set it to 0 it will be infinite(default)\n    ccdb_script::run_parsed_var(parse, \u0026mut var);\n}\n```\n  \n# Syntax\n  \n```txt\n\n[(Command)arguments]\n\nexample: \n[(var)test \"test\"]\n[(print)test]\n[(print)\"Hello, world\"]\n[(if)test == \"test\"]\n[(edit)test \"test2\"]\n\n[(print)\"new test\"]\n\n[(print)test]\n[(print)\"That is true\"]\n\n[(print)\"dropping test\"]\n/ drop a variable by using drop\n[(drop)test]\n\n[(if stop)]\n\n[(var)int \"0\"]\n[(print)int]\n/ use + / - and * like this before the number to do a math operation\n[(edit)int +100]\n[(print)int]\n[(custom) arg1 ,\u003c arg2 arg3 ...]\n/ split the line using ,\u003c\n\n```\n  \n# Uses  \n  \nThis language is made to be easily integrated in ccdb  \nand other projects  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmmanfred%2Fccdb-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalmmanfred%2Fccdb-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmmanfred%2Fccdb-script/lists"}